subtle.generateKey(algorithm, extractable, keyUsages)


使用 algorithm 中提供的参数,该方法尝试生成新的密钥材料。根据所使用的算法,将生成单个 <CryptoKey><CryptoKeyPair>

🌐 Using the parameters provided in algorithm, this method attempts to generate new keying material. Depending on the algorithm used either a single <CryptoKey> or a <CryptoKeyPair> is generated.

支持的 <CryptoKeyPair>(公钥和私钥)生成算法包括:

🌐 The <CryptoKeyPair> (public and private key) generating algorithms supported include:

  • 'RSASSA-PKCS1-v1_5'
  • 'RSA-PSS'
  • 'RSA-OAEP'
  • 'ECDSA'
  • 'Ed25519'
  • 'Ed448' 1
  • 'ECDH'
  • 'X25519'
  • 'X448' 1

支持的 <CryptoKey>(密钥)生成算法包括:

🌐 The <CryptoKey> (secret key) generating algorithms supported include:

  • 'HMAC'
  • 'AES-CTR'
  • 'AES-CBC'
  • 'AES-GCM'
  • 'AES-KW'