----- Forwarded by Andr�s Joo/Digital Reality/MSM/IBCGroup on 03/20/2001 04:34 PM -----
| L�r�nd Cs�ki
03/20/2001 04:24 PM
|
To: Andr�s Joo/Digital Reality/MSM/IBCGroup@IBCGroup cc: Subject: Need help with RSA private and public key verifying |
I did generate with the openssl command prompt utility some key pairs and certificates...
and I need to check if the public_key which is inside the X509
certificate, is the pair of the private key...
The x509_sig variable is loaded, and it seems to be ok...
I attached it any way...
The RSA private key seems to be ok, it is loaded in the rsa_sig, that is attached to...
Normaly if I encrypt a text with, the public key, end decrypt the encrypted value, with the private key, I should get the plaintext back... instead I only get after the decryption -1...
Can you help me?
Here is some of the code I have written so far...
evp=EVP_PKEY_new();
evp=X509_extract_key(x509_sig);
from="Hello World this is some test text";
from_len=strlen(from);
rsa=evp->pkey.rsa;
to_len=RSA_public_encrypt(from_len, from, to, rsa, RSA_PKCS1_PADDING);
dec_to_len=RSA_private_decrypt(to_len, to, dec_to, rsa_sig, RSA_PKCS1_PADDING);
Csiki Lorand Csaba
P.S. the Pem phrase and challenge passwords are "tintapok"
tintapok_encryption.rsa