Expand description
HKDF (RFC 5869) input keying material: the hash-independent half of
the HKDF surface. The ikm resource minted here parameterizes
derivations through the per-hash prepare interfaces (hkdf-sha2,
hkdf-sha1), so one imported secret serves either hash family.
Security:
- No operation returns an
ikm’s bytes, under any grant: WebCrypto’s forced non-extractability on HKDF base keys, made structural. - The implementation holds imported IKM in memory for the resource’s construction-to-drop lifetime; that window is the secret’s exposure to memory side channels. Import late, drop early. Dropping releases (and, in scrubbing implementations, zeroizes) it.
Structs§
- Ikm
- Input keying material: consumable only by
prepare, never readable. Usage grants are fixed at import and copied to every input prepared from it.
Functions§
- import_
ikm - Import input keying material. Empty material is accepted (RFC
5869 permits it, and the Web Cryptography API serves it), but an
implementation enforcing a security policy MAY reject degenerate
material with
error.invalid-key, as onhmac-sha2.import-key-raw. Failserror.not-permittedifoptionsgrants nothing, per the package-wide options contract. - unwrap_
ikm - Mint input keying material from unwrapped bytes (see the
wrappinginterface), subject toimport-ikm’s contract: a KDF secret can arrive under a wrapping key and parameterize derivations without its bytes ever being observable. Likeimport-ikm, this is not a format choice — the bytes are the material.inputis consumed.