Skip to content

Commit

Permalink
Add Sec1 EC key support
Browse files Browse the repository at this point in the history
  • Loading branch information
farcaller committed Feb 4, 2022
1 parent 109b643 commit f6760a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pemfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub enum Item {

/// A DER-encoded plaintext private key; as specified in PKCS#8/RFC5958
PKCS8Key(Vec<u8>),

/// A Sec1-encoded plaintext private key; as specified in RFC5915
ECKey(Vec<u8>),
}

impl Item {
Expand All @@ -20,6 +23,7 @@ impl Item {
"CERTIFICATE" => Some(Item::X509Certificate(der)),
"RSA PRIVATE KEY" => Some(Item::RSAKey(der)),
"PRIVATE KEY" => Some(Item::PKCS8Key(der)),
"EC PRIVATE KEY" => Some(Item::ECKey(der)),
_ => None,
}
}
Expand Down

0 comments on commit f6760a2

Please sign in to comment.