Skip to main content

derive_key

Function derive_key 

Source
pub async fn derive_key(
    variant: AesVariant,
    input: &DeriveInput,
    options: AeadKeyOptions,
) -> Result<AeadKey, Error>
Expand description

Mint a key from a parameterized derivation: the derivation runs at the variant’s key length (WebCrypto’s deriveKey chain — get key length, derive bits, import) and the result is subject to import-key-raw’s contract.

Requires can-derive-key on the input, else error.not-permitted. Requesting an extractable key requires can-derive-bits too: an exportable key is bits disclosure by other means.