subtle.generateKey(algorithm, extractable, keyUsages)
algorithm
:<string> | <AlgorithmIdentifier> | <RsaHashedKeyGenParams> | <EcKeyGenParams> | <HmacKeyGenParams> | <AesKeyGenParams>
-
extractable
:<boolean> -
keyUsages
:<string[]> 参见 关键用法。¥
keyUsages
: <string[]> See Key usages. -
返回:<Promise> 成功后获得 <CryptoKey> | <CryptoKeyPair>。
¥Returns: <Promise> Fulfills with a <CryptoKey> | <CryptoKeyPair> upon success.
使用 algorithm
中提供的方法和参数,subtle.generateKey()
尝试生成新的密钥材料。根据使用的方法,该方法可能会生成单个 <CryptoKey> 或 <CryptoKeyPair>。
¥Using the method and parameters provided in algorithm
, subtle.generateKey()
attempts to generate new keying material. Depending the method used, the method
may generate either a single <CryptoKey> or a <CryptoKeyPair>.
支持的 <CryptoKeyPair>(公钥和私钥)生成算法包括:
¥The <CryptoKeyPair> (public and private key) generating algorithms supported include:
支持的 <CryptoKey>(密钥)生成算法包括:
¥The <CryptoKey> (secret key) generating algorithms supported include:
-
'HMAC'
-
'AES-CTR'
-
'AES-CBC'
-
'AES-GCM'
-
'AES-KW'