cryptoKey.usages
- 类型: <string[]>
一个字符串数组,用于标识该密钥可以使用的操作。
【An array of strings identifying the operations for which the key may be used.】
可能的用法是:
【The possible usages are:】
'encrypt'- 密钥可用于加密数据。'decrypt'- 密钥可用于解密数据。'sign'- 该密钥可用于生成数字签名。'verify'- 该密钥可用于验证数字签名。'deriveKey'- 该密钥可用于派生新密钥。'deriveBits'- 该密钥可用于派生位。'wrapKey'- 该密钥可以用于封装另一个密钥。'unwrapKey'- 该密钥可以用于解封另一个密钥。
有效的密钥用途取决于密钥算法(由 cryptokey.algorithm.name 标识)。
【Valid key usages depend on the key algorithm (identified by
cryptokey.algorithm.name).】
| Key Type | 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'deriveKey' | 'deriveBits' | 'wrapKey' | 'unwrapKey' |
|---|---|---|---|---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | ✔ | ✔ | ||||
'AES-CTR' | ✔ | ✔ | ✔ | ✔ | ||||
'AES-GCM' | ✔ | ✔ | ✔ | ✔ | ||||
'AES-KW' | ✔ | ✔ | ||||||
'ECDH' | ✔ | ✔ | ||||||
'X25519' | ✔ | ✔ | ||||||
'X448' 1 | ✔ | ✔ | ||||||
'ECDSA' | ✔ | ✔ | ||||||
'Ed25519' | ✔ | ✔ | ||||||
'Ed448' 1 | ✔ | ✔ | ||||||
'HDKF' | ✔ | ✔ | ||||||
'HMAC' | ✔ | ✔ | ||||||
'PBKDF2' | ✔ | ✔ | ||||||
'RSA-OAEP' | ✔ | ✔ | ✔ | ✔ | ||||
'RSA-PSS' | ✔ | ✔ | ||||||
'RSASSA-PKCS1-v1_5' | ✔ | ✔ |