So I'm trying to use the der-parser
crate to parse an ecdsa ssh private key. The structure is defined as:
ECPrivateKey ::= SEQUENCE {
version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
privateKey OCTET STRING,
parameters [0] ECDomainParameters {{ SECGCurveNames }} OPTIONAL, publicKey [1] BIT STRING OPTIONAL
}
I have code to handle the SEQUENCE, INTEGER, and OCTET STRING. Then there's the "parameters" which is an OID tagged with 0 and a BIT STRING tagged with 1. I'm not sure what that structure is called in ASN.1 terms (is it tagged?, is it a set?), and which der-parser macro/function corresponds to it. I have tried parse_der_explicit
but no luck so far.