Hi all !
 
I'm writing an application that needs write out a RSA private key password based encryption in DER format but I'm getting error from functions used for, follows my code and error codes:
 
ERR_load_crypto_strings ();
 out = BIO_new(BIO_s_file());
 
rsa = RSA_generate_key (bits, e_value, i_progreso, NULL ); /*ok */
clave = EV_PKEY_new();
EVP_PKEY_assign_RSA (clave, rsa); /*rsa in EVP_PKEY structure */
 
res = PEM_write_bio_RSAPrivateKey (out, rsa, EVP_des_cbc(), NULL, 0, NULL, password); /*this works fine */
 
res = PEM_write_bio_PKCS8PrivateKey(out, clave, EVP_des_cbc(), NULL, 0, NULL, password); /*this breaks with follow error code:
error:06074079:digital envelope routines:EVP_PBE_CipherInit:unknown pbe algorith
merror:23077073:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 algor cipherinit errorer
ror:2306C067:PKCS12 routines:PKCS12_i2d_encrypt:encrypt errorerror:2307D067:PKCS
12 routines:PKCS8_encrypt:encrypt error0 */
 
res = i2d_PKCS8PrivateKey_bio (out, clave, EVP_des_cbc(), NULL, 0, NULL, password); /*this is the function that interest to me but also breaks with follow error code:
error:06074079:digital envelope routines:EVP_PBE_CipherInit:unknown pbe algorith
merror:23077073:PKCS12 routines:PKCS12_pbe_crypt:pkcs12 algor cipherinit errorer
ror:2306C067:PKCS12 routines:PKCS12_i2d_encrypt:encrypt errorerror:2307D067:PKCS
12 routines:PKCS8_encrypt:encrypt errorerror:0D074041:asn1 encoding routines:ASN
1_i2d_bio:malloc failure0 */
 
What's the problem with the two last functions ??
Do I making something erroneous??
 
Thanks in advance for your replies.
 
Zainos
 
 
 



Do You Yahoo!?
Yahoo! Net: La mejor conexión a internet y 25MB extra a tu correo por $100 al mes.

Reply via email to