subtle.deriveBits(algorithm, baseKey, length)
-
algorithm
:<AlgorithmIdentifier> | <EcdhKeyDeriveParams> | <HkdfParams> | <Pbkdf2Params> -
baseKey
:<CryptoKey> -
length
:<number> -
返回:<Promise> 包含 <ArrayBuffer>
¥Returns: <Promise> containing <ArrayBuffer>
使用 algorithm
中指定的方法和参数以及 baseKey
提供的密钥材料,subtle.deriveBits()
尝试生成 length
位。Node.js 实现要求 length
是 8
的倍数。如果成功,返回的 promise 将使用包含生成数据的 <ArrayBuffer> 进行解析。
¥Using the method and parameters specified in algorithm
and the keying
material provided by baseKey
, subtle.deriveBits()
attempts to generate
length
bits. The Node.js implementation requires that length
is a
multiple of 8
. If successful, the returned promise will be resolved with
an <ArrayBuffer> containing the generated data.
目前支持的算法包括:
¥The algorithms currently supported include:
-
'ECDH'
-
'HKDF'
-
'PBKDF2'