Do not encrypt with a private key. Encrypt with the public key and
decrypt with the private key.
I would extract the key parts by converting the pem format to an RSA
structure, get the BIGNUMs from the structure, and convert BIGNUM to bin.
I don't guarantee that this is the best way, but it will fork.
On 11/17/2013 5:11 AM, Ameet Lann wrote:
Hi,
We work on verification of code in our company.
We use the openssl to generate the key-pair and then to encrypt data
using the key-pair. However we would like to verify that we do
everything correctly so we want to encrypt independently using the
private key. So our question is how do we extract the private key as a
256 byte out of the 1766 bytes in HEX format of the private key section
inside the key.pem?
Regards,
Ameet
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager majord...@openssl.org