<div dir="ltr">Hello Openssl users,<div><br></div><div>Am facing following issue while am loading ECDSA private key using EVP_PKCS82PKEY().</div><div><br></div><div>I hope am missing some initialization in this regard. Can you please point me what am i doing wrong. </div><div><br></div><div>Steps followed :</div><div>Have generated CSR and signed using openssl commans. </div><div><br></div><div>Following are the parameters updated in the certificate. </div><div><br></div><div><div>Certificate:</div><div>    Data:</div><div>        Version: 3 (0x2)</div><div>        Serial Number: 6 (0x6)</div><div>    Signature Algorithm: ecdsa-with-SHA256</div><div>        Issuer: CN=ecdsa</div><div>        Validity</div><div>            Not Before: Feb  2 06:00:29 2015 GMT</div><div>            Not After : Feb  2 06:00:29 2016 GMT</div><div>        Subject: CN=eccert</div><div>        Subject Public Key Info:</div><div>            Public Key Algorithm: id-ecPublicKey</div><div>                Public-Key: (256 bit)</div><div>                pub:</div><div>                   </div><div>                ASN1 OID: prime256v1</div><div>        X509v3 extensions:</div><div>            X509v3 Subject Key Identifier:</div><div>              </div><div>            X509v3 Authority Key Identifier:</div><div>               </div><div><br></div><div>            X509v3 Key Usage: critical</div><div>                Digital Signature</div><div>    Signature Algorithm: ecdsa-with-SHA256</div></div><div><br></div><div>Step 2 : Tried to convert the private key in to PKCS8 format. </div><div><br></div><div>Step 3 : Tried to call "EVP_PKCS82PKEY(pkey)".</div><div><br></div><div>This function is always returning NULL. </div><div><br></div><div>When further checked on the return types, i could see following. </div><div><br></div><div>As part of "PKCS8_pkey_get0(&algoid, NULL, NULL, NULL, p8)", the type is of V_ASN1_OCTET_STRING. (i.e. p8->pkey->type == V_ASN1_OCTET_STRING).</div><div><br></div><div><br></div><div>But OBJ_obj2nid(algoid) returning the nid value as 0 i.e. NID_undef. </div><div><br></div><div>Due to this, EVP_PKEY_set_type(pkey, OBJ_obj2nid(algoid)) always returns NULL. </div><div><br></div><div>Can you help me to get out of this error. </div><div><br></div><div>Thanks,</div><div>Rajeswari.</div></div>