Does anybody have any working example of RSA encryption with OpenSSL.NET ? I want to encrypt some data using private key stored in PEM format.
I create a OpenSSL.Crypto.RSA object and want to use the PrivateEncrypt method, but it throws OpenSSLException with no additional data (empty Errors array, no inner exception). Before using the PrivateEncrypt method I fill all the properties (like PublicModulus, PrivateExponent etc) with data read from command
openssl rsa -in private_key.pem -text -noout
Does anybody know how to read the PEM file into OpenSSL.Crypto.RSA object or has any other working encryption example?
This is C/C++ on linux but I found no simple examples like this until I painfully got this to work
Generate key command line
HelloWord.cpp
Makefile