Skip to main content

import_secret_key_pkcs8

Function import_secret_key_pkcs8 

Source
pub async fn import_secret_key_pkcs8(
    variant: EcdhVariant,
    pkcs8: Vec<u8>,
    options: AgreementKeyOptions,
) -> Result<SecretKey, Error>
Expand description

Import a static secret key as a PKCS#8 PrivateKeyInfo (DER, the RFC 5915 ECPrivateKey body). The encoded curve must match the declared variant’s (error.invalid-key), and the scalar must lie in [1, n-1]; an embedded public key, when present, is validated against the scalar and never trusted on its own.