> 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]