I can generate, encrypt/decrypt strings by referring to many samples posted in the last decade.
What I really need to accomplish is to be able to:
- import private key from a "xxxx.key" key file and encrypt a string with the private key.
- And then, extract the public key from a "xxxx.crt" certificate file and decrypt the cypher text.
I have generated public/private keys as well as self-signed certificate and stored in files using openssl binaries.
There are zillion samples that show how to generate keys (not importing from a file) and encrypt via public key.
There is a similar question that was partially answered and is not complete in this thread: How to encrypt a string with private key and decrypt with public key?
I'll appreciate any support and sample code (preferably in C++/C#/VB.NET).