subtle.deriveBits(algorithm, baseKey[, length])
algorithm<EcdhKeyDeriveParams> | <HkdfParams> | <Pbkdf2Params>baseKey<CryptoKey>length<number> | <null> 默认值:null- 返回:<Promise> 在成功时以 <ArrayBuffer> 完成。
使用 algorithm 中指定的方法和参数,以及由 baseKey 提供的密钥材料,该方法尝试生成 length 位。
🌐 Using the method and parameters specified in algorithm and the keying
material provided by baseKey, this method attempts to generate
length bits.
当未提供 length 或其为 null 时,会生成给定算法的最大位数。对于 'ECDH'、'X25519' 和 'X448'5 算法,这是允许的;对于其他算法,length 必须是一个数字。
🌐 When length is not provided or null the maximum number of bits for a given
algorithm is generated. This is allowed for the 'ECDH', 'X25519', and 'X448'5
algorithms, for other algorithms length is required to be a number.
如果成功,返回的 promise 将会被解析为一个包含生成数据的 <ArrayBuffer>。
🌐 If successful, the returned promise will be resolved with an <ArrayBuffer> containing the generated data.
目前支持的算法包括:
🌐 The algorithms currently supported include:
'Argon2d'[^现代算法]'Argon2i'[^现代算法]'Argon2id'[^现代算法]'ECDH''HKDF''PBKDF2''X25519''X448'5