Skip to main content

decode_ed25519_pkcs8_der

Function decode_ed25519_pkcs8_der 

Source
pub fn decode_ed25519_pkcs8_der(der: &[u8]) -> Result<SecretKey, Pkcs8Error>
Expand description

Decodes a PKCS#8 PrivateKeyInfo DER containing an Ed25519 key.

Returns the key’s 32-byte seed via ed25519::SecretKey.

Both the RFC 8410 nested OCTET STRING form and the bare 32-byte form are accepted. An optional [1] public key field is ignored.

Returns Pkcs8Error when the structure is malformed, the algorithm is not Ed25519, or the seed has the wrong length.