For example I have generated signature:
$ openssl rsautl -sign -inkey private_key.pem -keyform PEM -in data > signature
Then if I want to verify it, I just do:
$ openssl rsautl -verify -inkey public_key.pem -in signature -pubin
And the output will be my data encoded in first step.
So the question is, how to implement this verification with Java? Can I use Signature class somehow or any other way?
P.S. 1 more question: As I know, public key must not be used to decrypt rsa signature, but anyway, in my example it is used for that. So anyone who has public key, can decrypt my message?
Thanks