Skip to main content

generate_key

Function generate_key 

Source
pub async fn generate_key(
    variant: Sha2Variant,
    length: Option<u32>,
    options: MacKeyOptions,
) -> Result<Mac, Error>
Expand description

Generate a fresh random HMAC key over variant.

length is the key length in bits; None means the underlying hash’s block size (WebCrypto’s generateKey default).