Crate sec1_decode

Source
Expand description

Crate for parsing EcPrivateKey structures as defined in SEC1 section C4. This is the default format generated by openssl for ec keys.

const PEM:&str = "-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIASgox4rXoGc6ajVAjBCsjVIjbfHd8OK3m5v34ZWVBmmoAoGCCqGSM49
AwEHoUQDQgAEUfXAsSR5LH4rVdHbcK1vnYcN9I/6T7u1bl1RprSZFf89aZXL+CeG
G21XVW8IDhjU7HAXgrO1Sqj00zQtluVBTg==
-----END EC PRIVATE KEY-----";

let parsed = parse_pem(PEM.as_bytes()).unwrap();

Modules§

error

Structs§

EcPrivateKey
The SEC1 EcPrivateKey structure decoded from the input.

Functions§

parse_der
Attempts to parse an EcPrivateKey sequence from the passed DER bytes.
parse_pem
Attempts to parse an EcPrivateKey sequence from the passed PEM bytes.