Expand description
The derivation primitive kind: turning secrets that are not yet keys —
an agreement’s shared secret, imported input keying material (IKM), a
password — into bits or typed keys, without the secret transiting the
caller.
Every WebCrypto deriveBits/deriveKey call operates on a pair the
spec never names: the base key plus the normalized algorithm parameters
(IKM + salt/info; password + salt/iterations; private key + peer
public). derive-input is that pair as a resource — a fully
parameterized derivation, lacking only the output length, which the
platform too supplies per use.
Sources construct it on their own interfaces (hkdf-sha2.prepare,
pbkdf2-sha2.prepare, an agreement’s agree); targets consume it
beside import-key-raw on their minting interfaces (aes-gcm.derive-key,
hmac-sha2.derive-key).
Security:
- Raw secret bytes enter only on the KDF interfaces, so nothing
reaching a
derive-keyhas skipped agreement-or-KDF, and no operation anywhere returns a base secret’s bytes. WebCrypto’s forced non-extractability on KDF base keys is a structural property here rather than a checked one.
Structs§
- Derive
Input - A fully parameterized derivation. The output may already be computed, or the computation may still be pending.
- Derive
Options - Mint-time policy for derivation base secrets, following the
package-wide options contract (see
README.md): the constructor grants nothing, at least one grant is required to mint, and the vocabulary is WebCrypto’s usage pair for derive-capable keys.