subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)


此方法使用 algorithm 指定的方法和参数以及 baseKey 提供的密钥材料,尝试基于 derivedKeyAlgorithm 中的方法和参数生成新的 <CryptoKey>

¥Using the method and parameters specified in algorithm, and the keying material provided by baseKey, this method attempts to generate a new <CryptoKey> based on the method and parameters in derivedKeyAlgorithm.

调用此方法相当于调用 subtle.deriveBits() 生成原始密钥材料,然后使用 deriveKeyAlgorithmextractablekeyUsages 参数将结果传递到 subtle.importKey() 方法中。

¥Calling this method 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:

  • 'Argon2d'4

  • 'Argon2i'4

  • 'Argon2id'4

  • 'ECDH'

  • 'HKDF'

  • 'PBKDF2'

  • 'X25519'

  • 'X448'5