lonestar (sent by Nabble.com) wrote:
Nils Larsch wrote:
lonestar (sent by Nabble.com) wrote:
well, i2d stands for "internal to DER" however the EC public key is not
really DER encoded
but the EC public key is passed as an internal struct, which should be
defined in ASN.1 notation.
please have a look at the sec 1 standard, see http://www.secg.org,
in particular section C.3 ("Syntax for Elliptic Curve Public Keys").
Nils Larsch wrote:
- it's simply the public key encoded as an octet string
(or a sequence of bytes) => it's called o2i_ECPublicKey ...
And as far as I know the internal structs are defined in ASN.1 notation.
Together with the Distinguished Encoding Rules (DER) it should be possible
to generate an interoperable encoding that can be interpreted on every
machine.
the SubjectPublicKeyInfo object for ec keys is of course an ASN.1 object
but the value of the BIT STRING subjectPublicKey is the value of the
ec public key encoded as an octet string (sequence of bytes and not the
ASN.1 type OCTET STRING) and hence we do not need to DER encode the ec
public key.
So if the public key struct (or the internals of it) is defined in ASN.1
notation, then it should also be possible to define a function like
i2d_ECPublicKey.
Cheers,
Nils
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]