Hi! I cannot answer the question *why* encoding/decoding is done in particular.
But some time ago OpenSC's ASN.1 implementation had the limitation to tags on one byte (ec public key is 7f49, I think). So, in a more general note, ASN.1 support in OpenSC could be extended. Or stop reimplementig everything and use something like asn1c, OpenSSL or whatever. For the nPA, I used the latter for encoding ASN.1/TLV. Greets, Frank. On Thursday, September 20 at 01:11AM, Andreas Schwier (ML) wrote: > > Dear all, > > we've come across a strange behaviour of the pkcs15-lib in OpenSC when > we generate an EC key pair: > > After generating an fresh EC key pair, our code returns a > sc_pkcs15_pubkey containing the EC public key and DER encoded domain > parameter. The public key is then encoded in sc_pkcs15init_generate_key > and added to the DF in the framework when it's immediately decoded again. > > During this encode / decode step the domain parameter are lost. > > I'm wondering why this encode / decode step is done ? > > If it is required for some reason, then I would rather encode the public > key in SubjectPublicKey structure that would also preserve the domain > parameter in AlgorithmIdentifier. > > Andreas > > -- > > --------- CardContact Software & System Consulting > |.##> <##.| Andreas Schwier > |# #| Schülerweg 38 > |# #| 32429 Minden, Germany > |'##> <##'| Phone +49 171 8334920 > --------- http://www.cardcontact.de > http://www.tscons.de > http://www.openscdp.org > > _______________________________________________ > opensc-devel mailing list > opensc-devel@lists.opensc-project.org > http://www.opensc-project.org/mailman/listinfo/opensc-devel > -- Frank Morgner Virtual Smart Card Architecture http://vsmartcard.sourceforge.net OpenPACE http://openpace.sourceforge.net IFD Handler for libnfc Devices http://sourceforge.net/projects/ifdnfc
pgpEfJU5vdrlL.pgp
Description: PGP signature
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel