Topic: Export public key to ecc_key structure
I have generated ECC key pair signed by CA with openssl tool in DER format.
I tried load public key to ecc_key structure but wc_EccPublicKeyDecode() returns ASN_OBJECT_ID_E.
Here is part of code:
// cert_der_ptr = 3082029C 30820243 A003020102 ...
int idx;
ecc_key pubk;
wc_ecc_init( &pubk );
idx = 0;
ret = wc_EccPublicKeyDecode( cert_der_ptr, &idx, &pubk, cert_der_size );
// here: ret == ASN_OBJECT_ID_E
// wc_EccPublicKeyDecode() expects two sequences and ObjectId but ObjectId is not on that possition:
// { GetSequence, GetSequence, SkipObjectId -> GetASNObjectId { b = 0xA0, b != ASN_OBJECT_ID -> return ASN_OBJECT_ID; } }
Here you can find decoded ASN.1 DER certificate:
https://lapo.it/asn1js/#3082029C3082024 … 90D63DBED7
Is it bug, unsupported DER format or something other wrong?