Skip to main content

decode_ec_sec1_der

Function decode_ec_sec1_der 

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

Decodes a SEC1 / RFC 5915 ECPrivateKey DER into a P-256 or P-384 key.

The named curve must be present in the [0] parameters field; the optional embedded public key is ignored.

Returns Pkcs8Error when the structure is malformed, the curve is not P-256 or P-384, or the scalar is not a valid private key.