cryptoKey.usages
-
类型:<string[]>
¥Type: <string[]>
标识可能使用键的操作的字符串数组。
¥An array of strings identifying the operations for which the key may be used.
可能的用法是:
¥The possible usages are:
-
'encrypt'
- 启用使用带有subtle.encrypt()
的密钥¥
'encrypt'
- Enable using the key withsubtle.encrypt()
-
'decrypt'
- 启用使用带有subtle.decrypt()
的密钥¥
'decrypt'
- Enable using the key withsubtle.decrypt()
-
'sign'
- 启用使用带有subtle.sign()
的密钥¥
'sign'
- Enable using the key withsubtle.sign()
-
'verify'
- 启用使用带有subtle.verify()
的密钥¥
'verify'
- Enable using the key withsubtle.verify()
-
'deriveKey'
- 启用使用带有subtle.deriveKey()
的密钥¥
'deriveKey'
- Enable using the key withsubtle.deriveKey()
-
'deriveBits'
- 启用使用带有subtle.deriveBits()
的密钥¥
'deriveBits'
- Enable using the key withsubtle.deriveBits()
-
'encapsulateBits'
- 启用使用带有subtle.encapsulateBits()
的密钥¥
'encapsulateBits'
- Enable using the key withsubtle.encapsulateBits()
-
'decapsulateBits'
- 启用使用带有subtle.decapsulateBits()
的密钥¥
'decapsulateBits'
- Enable using the key withsubtle.decapsulateBits()
-
'encapsulateKey'
- 启用使用带有subtle.encapsulateKey()
的密钥¥
'encapsulateKey'
- Enable using the key withsubtle.encapsulateKey()
-
'decapsulateKey'
- 启用使用带有subtle.decapsulateKey()
的密钥¥
'decapsulateKey'
- Enable using the key withsubtle.decapsulateKey()
-
'wrapKey'
- 启用使用带有subtle.wrapKey()
的密钥¥
'wrapKey'
- Enable using the key withsubtle.wrapKey()
-
'unwrapKey'
- 启用使用带有subtle.unwrapKey()
的密钥¥
'unwrapKey'
- Enable using the key withsubtle.unwrapKey()
有效的密钥用法取决于密钥算法(由 cryptokey.algorithm.name
标识)。
¥Valid key usages depend on the key algorithm (identified by
cryptokey.algorithm.name
).
列图例:
¥Column Legend:
-
加密算法:
subtle.encrypt()
/subtle.decrypt()
¥Encryption:
subtle.encrypt()
/subtle.decrypt()
-
签名和 MAC:
subtle.sign()
/subtle.verify()
¥Signatures and MAC:
subtle.sign()
/subtle.verify()
-
密钥或位派生:
subtle.deriveBits()
/subtle.deriveKey()
¥Key or Bits Derivation:
subtle.deriveBits()
/subtle.deriveKey()
-
密钥封装:
subtle.wrapKey()
/subtle.unwrapKey()
¥Key Wrapping:
subtle.wrapKey()
/subtle.unwrapKey()
-
密钥封装:
subtle.encapsulateBits()
/subtle.decapsulateBits()
/subtle.encapsulateKey()
/subtle.decapsulateKey()
¥Key Encapsulation:
subtle.encapsulateBits()
/subtle.decapsulateBits()
/subtle.encapsulateKey()
/subtle.decapsulateKey()
支持的密钥算法 | 加密算法 | 签名和 MAC | 密钥或位派生 | 密钥封装 | 密钥封装 |
---|---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | |||
'AES-CTR' | ✔ | ✔ | |||
'AES-GCM' | ✔ | ✔ | |||
'AES-KW' | ✔ | ||||
'AES-OCB' | ✔ | ✔ | |||
'ChaCha20-Poly1305' [^modern-algos] | ✔ | ✔ | |||
'ECDH' | ✔ | ||||
'ECDSA' | ✔ | ||||
'Ed25519' | ✔ | ||||
'Ed448' [^secure-curves] | ✔ | ||||
'HDKF' | ✔ | ||||
'HMAC' | ✔ | ||||
'ML-DSA-44' [^modern-algos] | ✔ | ||||
'ML-DSA-65' [^modern-algos] | ✔ | ||||
'ML-DSA-87' [^modern-algos] | ✔ | ||||
'ML-KEM-512' [^modern-algos] | ✔ | ||||
'ML-KEM-768' [^modern-algos] | ✔ | ||||
'ML-KEM-1024' [^modern-algos] | ✔ | ||||
'PBKDF2' | ✔ | ||||
'RSA-OAEP' | ✔ | ✔ | |||
'RSA-PSS' | ✔ | ||||
'RSASSA-PKCS1-v1_5' | ✔ | ||||
'X25519' | ✔ | ||||
'X448' [^secure-curves] | ✔ |