Expand description
hmac-sha1 key creation: HMAC over SHA-1, for interoperability with
SHA-1-committed constructions (TOTP, WPA2). HMAC’s security rests on
the PRF property, which SHA-1’s collision breaks do not reach; prefer
hmac_sha2 in new designs.
Functions§
- derive_
key - Mint an HMAC-SHA-1 key from a parameterized derivation. See
hmac_sha2::derive_keyfor thelengthand grant contracts. - generate_
key - Generate a fresh random HMAC-SHA-1 key.
lengthis the key length in bits;Nonemeans SHA-1’s block size, 512 bits. - import_
key_ jwk - Import an RFC 7517
octJSON Web Key (as JSON text;alg"HS1") as an HMAC-SHA-1 key. - import_
key_ raw - Import raw key material as an HMAC-SHA-1 key.