method webcrypto.SubtleCrypto.deriveKey
Jump to headingSubtleCrypto.deriveKey(algorithm: ,baseKey: CryptoKey,derivedKeyAlgorithm: ,extractable: boolean,keyUsages: readonly KeyUsage[],): Promise<CryptoKey>
Using the method and parameters specified in algorithm
, and the keying material provided by baseKey
,
subtle.deriveKey()
attempts to generate a new based on the method and parameters in
derivedKeyAlgorithm`.
Calling subtle.deriveKey()
is equivalent to calling subtle.deriveBits()
to generate raw keying material,
then passing the result into the subtle.importKey()
method using the deriveKeyAlgorithm
, extractable
, and keyUsages
parameters as input.
The algorithms currently supported include:
'ECDH'
'X25519'
'X448'
'HKDF'
'PBKDF2'
Parameters Jump to heading
Jump to headingalgorithm:
Jump to headingbaseKey: CryptoKey
Jump to headingderivedKeyAlgorithm:
Jump to headingextractable: boolean
Jump to headingkeyUsages: readonly KeyUsage[]
See Key usages.
Return Type Jump to heading
Promise<CryptoKey>