Using juce::RSAKey for verifying a digital signature

I understand how juce::RSAKey could be used to create an ecrypted message.

But can it be used to verify that a message was generated by the holder of the private key?

Usual approach is to take a hash of the message. Encrypt the hash with your private key.  People can verify the sig by decrypting the hash with your public key and seeing that it's the same as the hash of the message.

If you want good security use a well tested mainstream library that implements this all for you. There are a lot of ways to get crypto wrong ;)