You're right, I get RSA_R_BAD_E_VALUE (101). Just took the wrong define for the 
mail. ERR_GET_REASON returns 101.

I want to use RSA_public_decrypt to get back the hashvalue that was encrypted 
with RSA inside the smartcardterminal. And I don't get the private key of the 
card so I have to use the public key.
This is only for verification purpose.

Frank 

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von David Schwartz
Gesendet: Mittwoch, 1. August 2007 10:22
An: openssl-users@openssl.org
Betreff: RE: RSA_public_decrypt problem


> I'm trying to use the RSA_public_decrypt function but I need to set up 
> the public key "manually".
> I have the public exponent and modulus in the form of an array of 
> 'unsigned char' and have converted these to BIGNUM format using 
> BN_bin2bn. I assigned them to the RSA fields n and e.
> The I call RSA_public_decrypt, but it is returning -1. Calling 
> ERR_GET_REASON returns 101 (RSA_F_RSA_EAY_PRIVATE_DECRYPT?)?
> What does this mean and how do I need to change my program?

No, reason 101 is RSA_R_BAD_E_VALUE, assuming you're sure this was the return 
value from ERR_GET_REASON. This can only come from RSA_F_RSA_GENERATE_KEY. So 
either you're not giving the correct reason code or you're getting an error 
from a previous function.

> I'm using OpenSSL 0.9.8e and WinXP/Visual Studio 2005.
> The modulus and exponent values I set to the structure are read from a 
> smartcard.

Are you sure you want RSA_public_decrypt? This is normally only used for cust 
signature processing. (Normally decryption requires the private key.)

DS


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to