I'm working with a service that uses raw RSA with a private key to sign a payload. The data is effectively produced using:
openssl rsautl -inkey private_key.pem -raw -sign
(Also, the result of encrypting with the private key)
Unfortunately, in Pycrypto the corresponding .verify()
method only takes an argument to verify the data against to return true or false.
In openssl, this could be achieved with one of the following:
# Private key based
openssl rsautl -inkey private_key.pem -raw -verify
# Public key based
openssl rsautl -inkey public_key.pem -pubin -raw -verify
How can I achieve the same functionality in Pycrypto?
(I understand the risks of raw RSA. A custom padding mechanism has been implemented to mitigate some of those risks. Unfortunately, it's not possible to change the current implementation)