[openssl-users] ECDSA private key load error

Rajeswari K raji.kotamraju at gmail.com
Mon Feb 2 10:04:43 UTC 2015


Hello Openssl users,

Am facing following issue while am loading ECDSA private key using
EVP_PKCS82PKEY().

I hope am missing some initialization in this regard. Can you please point
me what am i doing wrong.

Steps followed :
Have generated CSR and signed using openssl commans.

Following are the parameters updated in the certificate.

Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 6 (0x6)
    Signature Algorithm: ecdsa-with-SHA256
        Issuer: CN=ecdsa
        Validity
            Not Before: Feb  2 06:00:29 2015 GMT
            Not After : Feb  2 06:00:29 2016 GMT
        Subject: CN=eccert
        Subject Public Key Info:
            Public Key Algorithm: id-ecPublicKey
                Public-Key: (256 bit)
                pub:

                ASN1 OID: prime256v1
        X509v3 extensions:
            X509v3 Subject Key Identifier:

            X509v3 Authority Key Identifier:


            X509v3 Key Usage: critical
                Digital Signature
    Signature Algorithm: ecdsa-with-SHA256

Step 2 : Tried to convert the private key in to PKCS8 format.

Step 3 : Tried to call "EVP_PKCS82PKEY(pkey)".

This function is always returning NULL.

When further checked on the return types, i could see following.

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).


But OBJ_obj2nid(algoid) returning the nid value as 0 i.e. NID_undef.

Due to this, EVP_PKEY_set_type(pkey, OBJ_obj2nid(algoid)) always returns
NULL.

Can you help me to get out of this error.

Thanks,
Rajeswari.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20150202/13b5d909/attachment.html>


More information about the openssl-users mailing list