Skip to content

Add parsing of ECC key pairs #438

@hug-dev

Description

@hug-dev

Depending on the provider and how they use ECC keys, it might be useful to have a way to parse the ECC key pairs. This is specially useful for the ImportKey/ExportKey operations.

See this comment for details:

For the ECC key pairs, the format is explained here and is the ASN.1 type ECPrivateKey:

   ECPrivateKey ::= SEQUENCE {
     version        INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
     privateKey     OCTET STRING,
     parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
     publicKey  [1] BIT STRING OPTIONAL
   }

We are using the picky crates to do ASN.1 parsing/serialization and before we were also defining our own ASN.1 types, like for RSA keys. See #201 for example.
As an initial step, we should make a PR to add support for ECPrivateKey in picky-asn1-x509 crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions