Skip to main content

Module hmac_sha2

Module hmac_sha2 

Source
Expand description

hmac-sha2 key creation.

Enums§

Sha2Variant
The SHA-2 variants: FIPS 180-4 closes this set, so it is an enum. (Each algorithm interface names its closed set of parameterizations <algorithm>-variant.)

Functions§

derive_key
Mint an HMAC key over variant from a parameterized derivation: the derivation runs at length bits (None means the hash’s block size, the generate_key default) and the result is subject to import_key_raw’s contract.
generate_key
Generate a fresh random HMAC key over variant.
import_key_jwk
Import an RFC 7517 oct JSON Web Key (as JSON text) as an HMAC key over variant. See the WIT mac-key.export-key-jwk doc for the package-wide JWK contract.
import_key_raw
Import raw key material as an HMAC key over variant.
unwrap_key_jwk
Mint an HMAC key from unwrapped key material read as an oct JWK, with the unwrap-path use/key_ops checks. Consumes the UnwrapInput.
unwrap_key_raw
Mint an HMAC key over the declared SHA-2 variant from unwrapped key material read as raw bytes. Consumes the UnwrapInput.