<div dir="ltr"><p class="">Hi Folks,</p>

<p class=""> </p>

<p class="">Need help.</p>

<p class=""> </p>

<p class="">I’m not able to encrypt a key using passphrase, below is
the error message.</p>

<p class=""><b>*"error:0D07209B:asn1 encoding
routines:ASN1_get_object:too long"*</b></p>

<p class=""><b> </b></p>

<p class="">Have already googled for error but couldn't got much info</p>

<p class=""> </p>

<p class=""> </p>

<p class="">Snippet of my code: </p>

<p class=""> </p>

<p class="">unsigned char pass[] = "123456";</p>

<p class="">BIO *priv_bio = BIO_new( BIO_s_mem() );</p>

<p class="">RSA *rsa = RSA_generate_key( 2048, 65537, NULL, NULL ) <br>
ret = PEM_write_bio_RSAPrivateKey( priv_bio, rsa, EVP_aes_256_cbc(), pass, 64,
NULL, NULL );</p>

<p class=""> </p>

<p class="">if(!ret) {</p>

<p class="">    ERR_error_string(ERR_get_error(),
buffer);</p>

<p class="">    printf(buffer);</p>

<p class="">}</p>

<p class=""> </p>

<p class=""> </p>

<p class="">The same piece of code is working on openssl-0.9.8zg.</p>

<p class=""> </p>

<p class="">Can I know what’s missing or any further debug steps to
check this issue?</p>

<p class=""> </p><p class=""><br></p><p class="">Thanks,</p><p class="">Ranjith</p></div>