
- assert 断言
- async_hooks 异步钩子
- async_hooks/context 异步上下文
- buffer 缓冲区
- C++插件
- C/C++插件(使用 Node-API)
- C++嵌入器
- child_process 子进程
- cluster 集群
- CLI 命令行
- console 控制台
- crypto 加密
- crypto/webcrypto 网络加密
- debugger 调试器
- deprecation 弃用
- dgram 数据报
- diagnostics_channel 诊断通道
- dns 域名服务器
- domain 域
- Error 错误
- events 事件触发器
- fs 文件系统
- global 全局变量
- http 超文本传输协议
- http2 超文本传输协议 2.0
- https 安全超文本传输协议
- inspector 检查器
- Intl 国际化
- module 模块
- module/cjs CommonJS 模块
- module/esm ECMAScript 模块
- module/package 包模块
- module/typescript TS 模块
- net 网络
- os 操作系统
- path 路径
- perf_hooks 性能钩子
- permission 权限
- process 进程
- punycode 域名代码
- querystring 查询字符串
- readline 逐行读取
- repl 交互式解释器
- report 诊断报告
- sea 单个可执行应用程序
Node.js v24.7.0 文档
- Node.js v24.7.0
-
目录
- 网络加密 API
- Web 加密 API 中的现代算法
- Web Cryptography API 中的安全曲线
- 示例
- 算法矩阵
- 类:
Crypto
- 类:
CryptoKey
- 类:
CryptoKeyPair
- 类:
SubtleCrypto
- 静态方法:
SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])
subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)
subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, usages)
subtle.decrypt(algorithm, key, data)
subtle.deriveBits(algorithm, baseKey[, length])
subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)
subtle.digest(algorithm, data)
subtle.encapsulateBits(encapsulationAlgorithm, encapsulationKey)
subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, usages)
subtle.encrypt(algorithm, key, data)
subtle.exportKey(format, key)
subtle.getPublicKey(key, keyUsages)
subtle.generateKey(algorithm, extractable, keyUsages)
subtle.importKey(format, keyData, algorithm, extractable, keyUsages)
subtle.sign(algorithm, key, data)
subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)
subtle.verify(algorithm, key, signature, data)
subtle.wrapKey(format, key, wrappingKey, wrapAlgo)
- 静态方法:
- 算法参数
- 类:
Algorithm
- 类:
AeadParams
- 类:
AesDerivedKeyParams
- 类:
AesCbcParams
- 类:
AesCtrParams
- 类:
AesKeyAlgorithm
- 类:
AesKeyGenParams
- 类:
ContextParams
- 类:
CShakeParams
- 类:
EcdhKeyDeriveParams
- 类:
EcdsaParams
- 类:
EcKeyAlgorithm
- 类:
EcKeyGenParams
- 类:
EcKeyImportParams
- 类:
Ed448Params
- 类:
EncapsulatedBits
- 类:
EncapsulatedKey
- 类:
HkdfParams
- 类:
HmacImportParams
- 类:
HmacKeyAlgorithm
- 类:
HmacKeyGenParams
- 类:
KeyAlgorithm
- 类:
Pbkdf2Params
- 类:
RsaHashedImportParams
- 类:
RsaHashedKeyAlgorithm
- 类:
RsaHashedKeyGenParams
- 类:
RsaOaepParams
- 类:
RsaPssParams
- 类:
- 网络加密 API
-
导航
- assert 断言
- async_hooks 异步钩子
- async_hooks/context 异步上下文
- buffer 缓冲区
- C++插件
- C/C++插件(使用 Node-API)
- C++嵌入器
- child_process 子进程
- cluster 集群
- CLI 命令行
- console 控制台
- crypto 加密
- crypto/webcrypto 网络加密
- debugger 调试器
- deprecation 弃用
- dgram 数据报
- diagnostics_channel 诊断通道
- dns 域名服务器
- domain 域
- Error 错误
- events 事件触发器
- fs 文件系统
- global 全局变量
- http 超文本传输协议
- http2 超文本传输协议 2.0
- https 安全超文本传输协议
- inspector 检查器
- Intl 国际化
- module 模块
- module/cjs CommonJS 模块
- module/esm ECMAScript 模块
- module/package 包模块
- module/typescript TS 模块
- net 网络
- os 操作系统
- path 路径
- perf_hooks 性能钩子
- permission 权限
- process 进程
- punycode 域名代码
- querystring 查询字符串
- readline 逐行读取
- repl 交互式解释器
- report 诊断报告
- sea 单个可执行应用程序
- 其他版本
网络加密 API#>
¥Web Crypto API
¥Stability: 2 - Stable
Node.js 提供了 网络加密 API 标准的实现。
¥Node.js provides an implementation of the Web Crypto API standard.
使用 globalThis.crypto
或 require('node:crypto').webcrypto
访问此模块。
¥Use globalThis.crypto
or require('node:crypto').webcrypto
to access this
module.
const { subtle } = globalThis.crypto;
(async function() {
const key = await subtle.generateKey({
name: 'HMAC',
hash: 'SHA-256',
length: 256,
}, true, ['sign', 'verify']);
const enc = new TextEncoder();
const message = enc.encode('I love cupcakes');
const digest = await subtle.sign({
name: 'HMAC',
}, key, message);
})();
Web 加密 API 中的现代算法#>
¥Modern Algorithms in the Web Cryptography API
¥Stability: 1.1 - Active development
Node.js 提供了 Web 加密 API 中的现代算法 WICG 提案中以下功能的实现:
¥Node.js provides an implementation of the following features from the Modern Algorithms in the Web Cryptography API WICG proposal:
算法:
¥Algorithms:
-
'AES-OCB'
1 -
'ChaCha20-Poly1305'
-
'cSHAKE128'
-
'cSHAKE256'
-
'ML-DSA-44'
2 -
'ML-DSA-65'
2 -
'ML-DSA-87'
2 -
'ML-KEM-1024'
2 -
'ML-KEM-512'
2 -
'ML-KEM-768'
2 -
'SHA3-256'
-
'SHA3-384'
-
'SHA3-512'
密钥格式:
¥Key Formats:
-
'raw-public'
-
'raw-secret'
-
'raw-seed'
方法:
¥Methods:
Web Cryptography API 中的安全曲线#>
¥Secure Curves in the Web Cryptography API
¥Stability: 1.1 - Active development
Node.js 提供了 Web Cryptography API 中的安全曲线 WICG 提案中以下功能的实现:
¥Node.js provides an implementation of the following features from the Secure Curves in the Web Cryptography API WICG proposal:
算法:
¥Algorithms:
-
'Ed448'
-
'X448'
示例#>
¥Examples
生成密钥#>
¥Generating keys
<SubtleCrypto> 类可用于生成对称(秘密)密钥或非对称密钥对(公钥和私钥)。
¥The <SubtleCrypto> class can be used to generate symmetric (secret) keys or asymmetric key pairs (public key and private key).
AES 密钥#>
¥AES keys
const { subtle } = globalThis.crypto;
async function generateAesKey(length = 256) {
const key = await subtle.generateKey({
name: 'AES-CBC',
length,
}, true, ['encrypt', 'decrypt']);
return key;
}
ECDSA 密钥对#>
¥ECDSA key pairs
const { subtle } = globalThis.crypto;
async function generateEcKey(namedCurve = 'P-521') {
const {
publicKey,
privateKey,
} = await subtle.generateKey({
name: 'ECDSA',
namedCurve,
}, true, ['sign', 'verify']);
return { publicKey, privateKey };
}
Ed25519/X25519 密钥对#>
¥Ed25519/X25519 key pairs
const { subtle } = globalThis.crypto;
async function generateEd25519Key() {
return subtle.generateKey({
name: 'Ed25519',
}, true, ['sign', 'verify']);
}
async function generateX25519Key() {
return subtle.generateKey({
name: 'X25519',
}, true, ['deriveKey']);
}
HMAC 密钥#>
¥HMAC keys
const { subtle } = globalThis.crypto;
async function generateHmacKey(hash = 'SHA-256') {
const key = await subtle.generateKey({
name: 'HMAC',
hash,
}, true, ['sign', 'verify']);
return key;
}
RSA 密钥对#>
¥RSA key pairs
const { subtle } = globalThis.crypto;
const publicExponent = new Uint8Array([1, 0, 1]);
async function generateRsaKey(modulusLength = 2048, hash = 'SHA-256') {
const {
publicKey,
privateKey,
} = await subtle.generateKey({
name: 'RSASSA-PKCS1-v1_5',
modulusLength,
publicExponent,
hash,
}, true, ['sign', 'verify']);
return { publicKey, privateKey };
}
加密与解密#>
¥Encryption and decryption
const crypto = globalThis.crypto;
async function aesEncrypt(plaintext) {
const ec = new TextEncoder();
const key = await generateAesKey();
const iv = crypto.getRandomValues(new Uint8Array(16));
const ciphertext = await crypto.subtle.encrypt({
name: 'AES-CBC',
iv,
}, key, ec.encode(plaintext));
return {
key,
iv,
ciphertext,
};
}
async function aesDecrypt(ciphertext, key, iv) {
const dec = new TextDecoder();
const plaintext = await crypto.subtle.decrypt({
name: 'AES-CBC',
iv,
}, key, ciphertext);
return dec.decode(plaintext);
}
导出和导入密钥#>
¥Exporting and importing keys
const { subtle } = globalThis.crypto;
async function generateAndExportHmacKey(format = 'jwk', hash = 'SHA-512') {
const key = await subtle.generateKey({
name: 'HMAC',
hash,
}, true, ['sign', 'verify']);
return subtle.exportKey(format, key);
}
async function importHmacKey(keyData, format = 'jwk', hash = 'SHA-512') {
const key = await subtle.importKey(format, keyData, {
name: 'HMAC',
hash,
}, true, ['sign', 'verify']);
return key;
}
封装和解包密钥#>
¥Wrapping and unwrapping keys
const { subtle } = globalThis.crypto;
async function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') {
const [
key,
wrappingKey,
] = await Promise.all([
subtle.generateKey({
name: 'HMAC', hash,
}, true, ['sign', 'verify']),
subtle.generateKey({
name: 'AES-KW',
length: 256,
}, true, ['wrapKey', 'unwrapKey']),
]);
const wrappedKey = await subtle.wrapKey(format, key, wrappingKey, 'AES-KW');
return { wrappedKey, wrappingKey };
}
async function unwrapHmacKey(
wrappedKey,
wrappingKey,
format = 'jwk',
hash = 'SHA-512') {
const key = await subtle.unwrapKey(
format,
wrappedKey,
wrappingKey,
'AES-KW',
{ name: 'HMAC', hash },
true,
['sign', 'verify']);
return key;
}
签名并验证#>
¥Sign and verify
const { subtle } = globalThis.crypto;
async function sign(key, data) {
const ec = new TextEncoder();
const signature =
await subtle.sign('RSASSA-PKCS1-v1_5', key, ec.encode(data));
return signature;
}
async function verify(key, signature, data) {
const ec = new TextEncoder();
const verified =
await subtle.verify(
'RSASSA-PKCS1-v1_5',
key,
signature,
ec.encode(data));
return verified;
}
派生位和密钥#>
¥Deriving bits and keys
const { subtle } = globalThis.crypto;
async function pbkdf2(pass, salt, iterations = 1000, length = 256) {
const ec = new TextEncoder();
const key = await subtle.importKey(
'raw',
ec.encode(pass),
'PBKDF2',
false,
['deriveBits']);
const bits = await subtle.deriveBits({
name: 'PBKDF2',
hash: 'SHA-512',
salt: ec.encode(salt),
iterations,
}, key, length);
return bits;
}
async function pbkdf2Key(pass, salt, iterations = 1000, length = 256) {
const ec = new TextEncoder();
const keyMaterial = await subtle.importKey(
'raw',
ec.encode(pass),
'PBKDF2',
false,
['deriveKey']);
const key = await subtle.deriveKey({
name: 'PBKDF2',
hash: 'SHA-512',
salt: ec.encode(salt),
iterations,
}, keyMaterial, {
name: 'AES-GCM',
length,
}, true, ['encrypt', 'decrypt']);
return key;
}
摘要#>
¥Digest
const { subtle } = globalThis.crypto;
async function digest(data, algorithm = 'SHA-512') {
const ec = new TextEncoder();
const digest = await subtle.digest(algorithm, ec.encode(data));
return digest;
}
检查运行时算法支持#>
¥Checking for runtime algorithm support
SubtleCrypto.supports()
允许在 Web Crypto API 中进行功能检测,可用于检测给定操作是否支持给定算法标识符(包括其参数)。
¥SubtleCrypto.supports()
allows feature detection in Web Crypto API,
which can be used to detect whether a given algorithm identifier
(including its parameters) is supported for the given operation.
此示例使用 Argon2(如果可用)或 PBKDF2(否则)从密码派生密钥;然后使用 AES-OCB(如果可用)或 AES-GCM(否则)对文本进行加密和解密。
¥This example derives a key from a password using Argon2, if available, or PBKDF2, otherwise; and then encrypts and decrypts some text with it using AES-OCB, if available, and AES-GCM, otherwise.
const { SubtleCrypto, crypto } = globalThis;
const password = 'correct horse battery staple';
const derivationAlg =
SubtleCrypto.supports?.('importKey', 'Argon2id') ?
'Argon2id' :
'PBKDF2';
const encryptionAlg =
SubtleCrypto.supports?.('importKey', 'AES-OCB') ?
'AES-OCB' :
'AES-GCM';
const passwordKey = await crypto.subtle.importKey(
derivationAlg === 'Argon2id' ? 'raw-secret' : 'raw',
new TextEncoder().encode(password),
derivationAlg,
false,
['deriveKey'],
);
const nonce = crypto.getRandomValues(new Uint8Array(16));
const derivationParams =
derivationAlg === 'Argon2id' ?
{
nonce,
parallelism: 4,
memory: 2 ** 21,
passes: 1,
} :
{
salt: nonce,
iterations: 100_000,
hash: 'SHA-256',
};
const key = await crypto.subtle.deriveKey(
{
name: derivationAlg,
...derivationParams,
},
passwordKey,
{
name: encryptionAlg,
length: 256,
},
false,
['encrypt', 'decrypt'],
);
const plaintext = 'Hello, world!';
const iv = crypto.getRandomValues(new Uint8Array(16));
const encrypted = await crypto.subtle.encrypt(
{ name: encryptionAlg, iv },
key,
new TextEncoder().encode(plaintext),
);
const decrypted = new TextDecoder().decode(await crypto.subtle.decrypt(
{ name: encryptionAlg, iv },
key,
encrypted,
));
算法矩阵#>
¥Algorithm matrix
下表详细说明了 Node.js Web Crypto API 实现支持的算法以及每种算法支持的 API:
¥The tables details the algorithms supported by the Node.js Web Crypto API implementation and the APIs supported for each:
密钥管理 API#>
¥Key Management APIs
算法 | subtle.generateKey() | subtle.exportKey() | subtle.importKey() | subtle.getPublicKey() |
---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | ✔ | |
'AES-CTR' | ✔ | ✔ | ✔ | |
'AES-GCM' | ✔ | ✔ | ✔ | |
'AES-KW' | ✔ | ✔ | ✔ | |
'AES-OCB' | ✔ | ✔ | ✔ | |
'ChaCha20-Poly1305' [^modern-algos] | ✔ | ✔ | ✔ | |
'ECDH' | ✔ | ✔ | ✔ | ✔ |
'ECDSA' | ✔ | ✔ | ✔ | ✔ |
'Ed25519' | ✔ | ✔ | ✔ | ✔ |
'Ed448' [^secure-curves] | ✔ | ✔ | ✔ | ✔ |
'HKDF' | ✔ | |||
'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] | ✔ | ✔ | ✔ | ✔ |
加密操作 API#>
¥Crypto Operation APIs
列图例:
¥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()
-
¥Digest:
subtle.digest()
算法 | 加密算法 | 签名和 MAC | 密钥或位派生 | 密钥封装 | 密钥封装 | 摘要 |
---|---|---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | ||||
'AES-CTR' | ✔ | ✔ | ||||
'AES-GCM' | ✔ | ✔ | ||||
'AES-KW' | ✔ | |||||
'AES-OCB' | ✔ | ✔ | ||||
'ChaCha20-Poly1305' [^modern-algos] | ✔ | ✔ | ||||
'cSHAKE128' [^modern-algos] | ✔ | |||||
'cSHAKE256' [^modern-algos] | ✔ | |||||
'ECDH' | ✔ | |||||
'ECDSA' | ✔ | |||||
'Ed25519' | ✔ | |||||
'Ed448' [^secure-curves] | ✔ | |||||
'HKDF' | ✔ | |||||
'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' | ✔ | |||||
'SHA-1' | ✔ | |||||
'SHA-256' | ✔ | |||||
'SHA-384' | ✔ | |||||
'SHA-512' | ✔ | |||||
'SHA3-256' [^modern-algos] | ✔ | |||||
'SHA3-384' [^modern-algos] | ✔ | |||||
'SHA3-512' [^modern-algos] | ✔ | |||||
'X25519' | ✔ | |||||
'X448' [^secure-curves] | ✔ |
类:Crypto
#>
¥Class: Crypto
globalThis.crypto
是 Crypto
类的实例。Crypto
是一个单例,它提供对其余加密 API 的访问。
¥globalThis.crypto
is an instance of the Crypto
class. Crypto
is a singleton that provides access to the remainder of the
crypto API.
crypto.subtle
#>
-
¥Type: <SubtleCrypto>
提供对 SubtleCrypto
API 的访问。
¥Provides access to the SubtleCrypto
API.
crypto.getRandomValues(typedArray)
#>
-
typedArray
<Buffer> | <TypedArray> -
返回:<Buffer> | <TypedArray>
¥Returns: <Buffer> | <TypedArray>
生成加密强随机值。给定的 typedArray
填充了随机值,并返回对 typedArray
的引用。
¥Generates cryptographically strong random values. The given typedArray
is
filled with random values, and a reference to typedArray
is returned.
给定的 typedArray
必须是 <TypedArray> 的基于整数的实例,即不接受 Float32Array
和 Float64Array
。
¥The given typedArray
must be an integer-based instance of <TypedArray>,
i.e. Float32Array
and Float64Array
are not accepted.
如果给定的 typedArray
大于 65,536 字节,将抛出错误。
¥An error will be thrown if the given typedArray
is larger than 65,536 bytes.
crypto.randomUUID()
#>
生成一个随机的 RFC 4122 版本 4 UUID。UUID 是使用加密伪随机数生成器生成的。
¥Generates a random RFC 4122 version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator.
类:CryptoKey
#>
¥Class: CryptoKey
cryptoKey.algorithm
#>
-
类型:KeyAlgorithm|RsaHashedKeyAlgorithm|EcKeyAlgorithm|AesKeyAlgorithm|HmacKeyAlgorithm
¥Type: KeyAlgorithm|RsaHashedKeyAlgorithm|EcKeyAlgorithm|AesKeyAlgorithm|HmacKeyAlgorithm
一个对象,详细说明可以使用密钥的算法以及其他特定于算法的参数。
¥An object detailing the algorithm for which the key can be used along with additional algorithm-specific parameters.
只读。
¥Read-only.
cryptoKey.extractable
#>
当 true
时,可以使用 subtleCrypto.exportKey()
或 subtleCrypto.wrapKey()
提取 <CryptoKey>。
¥When true
, the <CryptoKey> can be extracted using either
subtleCrypto.exportKey()
or subtleCrypto.wrapKey()
.
只读。
¥Read-only.
cryptoKey.type
#>
-
类型:<string>
'secret'
、'private'
或'public'
之一。¥Type: <string> One of
'secret'
,'private'
, or'public'
.
标识密钥是对称 ('secret'
) 还是非对称('private'
或 'public'
)密钥的字符串。
¥A string identifying whether the key is a symmetric ('secret'
) or
asymmetric ('private'
or 'public'
) key.
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] | ✔ |
类:CryptoKeyPair
#>
¥Class: CryptoKeyPair
CryptoKeyPair
是一个简单的字典对象,具有 publicKey
和 privateKey
属性,代表一个非对称密钥对。
¥The CryptoKeyPair
is a simple dictionary object with publicKey
and
privateKey
properties, representing an asymmetric key pair.
cryptoKeyPair.privateKey
#>
-
类型:<CryptoKey> <CryptoKey> 的
type
将是'private'
。¥Type: <CryptoKey> A <CryptoKey> whose
type
will be'private'
.
cryptoKeyPair.publicKey
#>
-
类型:<CryptoKey> <CryptoKey> 的
type
将是'public'
。¥Type: <CryptoKey> A <CryptoKey> whose
type
will be'public'
.
类:SubtleCrypto
#>
¥Class: SubtleCrypto
静态方法:SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])
#>
¥Static method: SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])
¥Stability: 1.1 - Active development
-
operation
<string> "encrypt"、"decrypt"、"sign"、"verify"、"digest"、"generateKey"、"deriveKey"、"deriveBits"、"importKey"、"exportKey"、"getPublicKey"、"wrapKey" 或 "unwrapKey"¥
operation
<string> "encrypt", "decrypt", "sign", "verify", "digest", "generateKey", "deriveKey", "deriveBits", "importKey", "exportKey", "getPublicKey", "wrapKey", or "unwrapKey" -
algorithm
<string> -
lengthOrAdditionalAlgorithm
<null> | <number> | <string> | <undefined> 根据操作的不同,此选项可以被忽略;操作为 "deriveBits" 时,长度参数的值会被忽略;操作为 "deriveKey" 时,密钥的导出算法会被忽略;操作为 "wrapKey" 时,密钥的封装前导出算法会被忽略;操作为 "unwrapKey" 时,密钥的解封装后导入算法会被忽略。默认值:当操作为 "deriveBits" 时为null
,否则为undefined
。¥
lengthOrAdditionalAlgorithm
<null> | <number> | <string> | <undefined> Depending on the operation this is either ignored, the value of the length argument when operation is "deriveBits", the algorithm of key to be derived when operation is "deriveKey", the algorithm of key to be exported before wrapping when operation is "wrapKey", or the algorithm of key to be imported after unwrapping when operation is "unwrapKey". Default:null
when operation is "deriveBits",undefined
otherwise. -
返回:<boolean> 指示实现是否支持给定操作
¥Returns: <boolean> Indicating whether the implementation supports the given operation
允许在 Web Crypto API 中进行功能检测,可用于检测给定操作是否支持给定算法标识符(包括其参数)。
¥Allows feature detection in Web Crypto API, which can be used to detect whether a given algorithm identifier (including its parameters) is supported for the given operation.
subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)
#>
¥Stability: 1.1 - Active development
-
decapsulationAlgorithm
<string> -
decapsulationKey
<CryptoKey> -
ciphertext
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功时将使用 <ArrayBuffer> 履行。
¥Returns: <Promise> Fulfills with <ArrayBuffer> upon success.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, usages)
#>
¥Stability: 1.1 - Active development
-
decapsulationAlgorithm
<string> -
decapsulationKey
<CryptoKey> -
ciphertext
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
sharedKeyAlgorithm
<string> | <HmacImportParams> -
extractable
<boolean> -
usages
<string[]> 参见 关键用法。¥
usages
<string[]> See Key usages. -
返回:<Promise> 成功时将使用 <CryptoKey> 履行。
¥Returns: <Promise> Fulfills with <CryptoKey> upon success.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.decrypt(algorithm, key, data)
#>
-
algorithm
<RsaOaepParams> | <AesCtrParams> | <AesCbcParams> -
key
<CryptoKey> -
data
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
使用 algorithm
中指定的方法和参数以及 key
提供的密钥材料,subtle.decrypt()
尝试解密提供的 data
。如果成功,返回的 promise 将使用包含明文结果的 <ArrayBuffer> 进行解析。
¥Using the method and parameters specified in algorithm
and the keying
material provided by key
, subtle.decrypt()
attempts to decipher the
provided data
. If successful, the returned promise will be resolved with
an <ArrayBuffer> containing the plaintext result.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.deriveBits(algorithm, baseKey[, length])
#>
-
algorithm
<EcdhKeyDeriveParams> | <HkdfParams> | <Pbkdf2Params> -
baseKey
<CryptoKey> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
使用 algorithm
中指定的方法和参数以及 baseKey
提供的密钥材料,subtle.deriveBits()
尝试生成 length
位。
¥Using the method and parameters specified in algorithm
and the keying
material provided by baseKey
, subtle.deriveBits()
attempts to generate
length
bits.
当未提供 length
或 null
时,将生成给定算法的最大位数。'ECDH'
、'X25519'
和 'X448'
4 算法允许这样做,对于其他算法,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'
4
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:
-
'ECDH'
-
'HKDF'
-
'PBKDF2'
-
'X25519'
-
'X448'
4
subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)
#>
-
algorithm
<EcdhKeyDeriveParams> | <HkdfParams> | <Pbkdf2Params> -
baseKey
<CryptoKey> -
derivedKeyAlgorithm
<string> | <HmacImportParams> -
extractable
<boolean> -
keyUsages
<string[]> 参见 关键用法。¥
keyUsages
<string[]> See Key usages. -
返回:<Promise> 成功后获得 <CryptoKey>。
¥Returns: <Promise> Fulfills with a <CryptoKey> upon success.
使用 algorithm
中指定的方法和参数,以及 baseKey
提供的密钥材料,subtle.deriveKey()
尝试基于 derivedKeyAlgorithm
中的方法和参数生成新的 <CryptoKey>。
¥Using the method and parameters specified in algorithm
, and the keying
material provided by baseKey
, subtle.deriveKey()
attempts to generate
a new <CryptoKey> based on the method and parameters in derivedKeyAlgorithm
.
调用 subtle.deriveKey()
相当于调用 subtle.deriveBits()
生成原始密钥材料,然后使用 deriveKeyAlgorithm
、extractable
和 keyUsages
参数作为输入将结果传递到 subtle.importKey()
方法。
¥Calling subtle.deriveKey()
is equivalent to calling subtle.deriveBits()
to
generate raw keying material, then passing the result into the
subtle.importKey()
method using the deriveKeyAlgorithm
, extractable
, and
keyUsages
parameters as input.
目前支持的算法包括:
¥The algorithms currently supported include:
-
'ECDH'
-
'HKDF'
-
'PBKDF2'
-
'X25519'
-
'X448'
4
subtle.digest(algorithm, data)
#>
-
algorithm
<string> -
data
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
使用 algorithm
标识的方法,subtle.digest()
尝试生成 data
的摘要。如果成功,返回的 promise 将使用包含计算摘要的 <ArrayBuffer> 进行解析。
¥Using the method identified by algorithm
, subtle.digest()
attempts to
generate a digest of data
. If successful, the returned promise is resolved
with an <ArrayBuffer> containing the computed digest.
如果 algorithm
作为 <string> 提供,则它必须是以下之一:
¥If algorithm
is provided as a <string>, it must be one of:
如果 algorithm
作为 <Object> 提供,则它必须具有值为上述之一的 name
属性。
¥If algorithm
is provided as an <Object>, it must have a name
property
whose value is one of the above.
subtle.encapsulateBits(encapsulationAlgorithm, encapsulationKey)
#>
¥Stability: 1.1 - Active development
-
encapsulationAlgorithm
<string> -
encapsulationKey
<CryptoKey> -
返回:<Promise> 成功时将使用 EncapsulatedBits 履行。
¥Returns: <Promise> Fulfills with EncapsulatedBits upon success.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, usages)
#>
¥Stability: 1.1 - Active development
-
encapsulationAlgorithm
<string> -
encapsulationKey
<CryptoKey> -
sharedKeyAlgorithm
<string> | <HmacImportParams> -
extractable
<boolean> -
usages
<string[]> 参见 关键用法。¥
usages
<string[]> See Key usages. -
返回:<Promise> 成功时将使用 EncapsulatedKey 履行。
¥Returns: <Promise> Fulfills with EncapsulatedKey upon success.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.encrypt(algorithm, key, data)
#>
-
algorithm
<RsaOaepParams> | <AesCtrParams> | <AesCbcParams> -
key
<CryptoKey> -
data
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
使用 algorithm
指定的方法和参数以及 key
提供的密钥材料,subtle.encrypt()
尝试对 data
进行加密。如果成功,返回的 promise 将使用包含加密结果的 <ArrayBuffer> 进行解析。
¥Using the method and parameters specified by algorithm
and the keying
material provided by key
, subtle.encrypt()
attempts to encipher data
.
If successful, the returned promise is resolved with an <ArrayBuffer>
containing the encrypted result.
目前支持的算法包括:
¥The algorithms currently supported include:
subtle.exportKey(format, key)
#>
-
format
<string> 必须是'raw'
、'pkcs8'
、'spki'
、'jwk'
、'raw-secret'
3、'raw-public'
3 或'raw-seed'
3 之一。¥
format
<string> Must be one of'raw'
,'pkcs8'
,'spki'
,'jwk'
,'raw-secret'
3,'raw-public'
3, or'raw-seed'
3. -
key
<CryptoKey> -
返回:<Promise> 成功后使用 <ArrayBuffer> | <Object> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> | <Object> upon success.
如果支持,将给定的密钥导出为指定的格式。
¥Exports the given key into the specified format, if supported.
如果 <CryptoKey> 不可提取,则返回的 promise 将被拒绝。
¥If the <CryptoKey> is not extractable, the returned promise will reject.
当 format
为 'pkcs8'
或 'spki'
且导出成功时,返回的 promise 将使用包含导出密钥数据的 <ArrayBuffer> 进行解析。
¥When format
is either 'pkcs8'
or 'spki'
and the export is successful,
the returned promise will be resolved with an <ArrayBuffer> containing the
exported key data.
当 format
为 'jwk'
且导出成功时,返回的 promise 将使用符合 JSON 网络密钥 规范的 JavaScript 对象解析。
¥When format
is 'jwk'
and the export is successful, the returned promise
will be resolved with a JavaScript object conforming to the JSON Web Key
specification.
支持的密钥算法 | 'spki' | 'pkcs8' | 'jwk' | 'raw' | 'raw-secret' | 'raw-public' | 'raw-seed' |
---|---|---|---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | ✔ | ||||
'AES-CTR' | ✔ | ✔ | ✔ | ||||
'AES-GCM' | ✔ | ✔ | ✔ | ||||
'AES-KW' | ✔ | ✔ | ✔ | ||||
'AES-OCB' [^modern-algos] | ✔ | ✔ | |||||
'ChaCha20-Poly1305' [^modern-algos] | ✔ | ✔ | |||||
'ECDH' | ✔ | ✔ | ✔ | ✔ | ✔ | ||
'ECDSA' | ✔ | ✔ | ✔ | ✔ | ✔ | ||
'Ed25519' | ✔ | ✔ | ✔ | ✔ | ✔ | ||
'Ed448' [^secure-curves] | ✔ | ✔ | ✔ | ✔ | ✔ | ||
'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] | ✔ | ✔ | ✔ | ✔ | |||
'RSA-OAEP' | ✔ | ✔ | ✔ | ||||
'RSA-PSS' | ✔ | ✔ | ✔ | ||||
'RSASSA-PKCS1-v1_5' | ✔ | ✔ | ✔ |
subtle.getPublicKey(key, keyUsages)
#>
¥Stability: 1.1 - Active development
-
key
<CryptoKey> 一个私钥,用于派生相应的公钥。¥
key
<CryptoKey> A private key from which to derive the corresponding public key. -
keyUsages
<string[]> 参见 关键用法。¥
keyUsages
<string[]> See Key usages. -
返回:<Promise> 成功后获得 <CryptoKey>。
¥Returns: <Promise> Fulfills with a <CryptoKey> upon success.
从给定的私钥派生公钥。
¥Derives the public key from a given private key.
subtle.generateKey(algorithm, extractable, keyUsages)
#>
algorithm
<string> | <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:
-
'ECDH'
-
'ECDSA'
-
'Ed25519'
-
'Ed448'
4 -
'ML-DSA-44'
3 -
'ML-DSA-65'
3 -
'ML-DSA-87'
3 -
'ML-KEM-512'
3 -
'ML-KEM-768'
3 -
'ML-KEM-1024'
3 -
'RSA-OAEP'
-
'RSA-PSS'
-
'RSASSA-PKCS1-v1_5'
-
'X25519'
-
'X448'
4
支持的 <CryptoKey>(密钥)生成算法包括:
¥The <CryptoKey> (secret key) generating algorithms supported include:
subtle.importKey(format, keyData, algorithm, extractable, keyUsages)
#>
-
format
<string> 必须是'raw'
、'pkcs8'
、'spki'
、'jwk'
、'raw-secret'
3、'raw-public'
3 或'raw-seed'
3 之一。¥
format
<string> Must be one of'raw'
,'pkcs8'
,'spki'
,'jwk'
,'raw-secret'
3,'raw-public'
3, or'raw-seed'
3. -
keyData
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <Object>
algorithm
<string> | <RsaHashedImportParams> | <EcKeyImportParams> | <HmacImportParams>
-
extractable
<boolean> -
keyUsages
<string[]> 参见 关键用法。¥
keyUsages
<string[]> See Key usages. -
返回:<Promise> 成功后获得 <CryptoKey>。
¥Returns: <Promise> Fulfills with a <CryptoKey> upon success.
subtle.importKey()
方法尝试将提供的 keyData
解释为给定的 format
,以使用提供的 algorithm
、extractable
和 keyUsages
参数创建 <CryptoKey> 实例。如果导入成功,返回的 promise 将使用创建的 <CryptoKey> 进行解析。
¥The subtle.importKey()
method attempts to interpret the provided keyData
as the given format
to create a <CryptoKey> instance using the provided
algorithm
, extractable
, and keyUsages
arguments. If the import is
successful, the returned promise will be resolved with the created <CryptoKey>.
如果导入 'PBKDF2'
密钥,extractable
必须是 false
。
¥If importing a 'PBKDF2'
key, extractable
must be false
.
目前支持的算法包括:
¥The algorithms currently supported include:
支持的密钥算法 | 'spki' | 'pkcs8' | 'jwk' | 'raw' | 'raw-secret' | 'raw-public' | 'raw-seed' |
---|---|---|---|---|---|---|---|
'AES-CBC' | ✔ | ✔ | ✔ | ||||
'AES-CTR' | ✔ | ✔ | ✔ | ||||
'AES-GCM' | ✔ | ✔ | ✔ | ||||
'AES-KW' | ✔ | ✔ | ✔ | ||||
'AES-OCB' [^modern-algos] | ✔ | ✔ | |||||
'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] | ✔ | ✔ | ✔ | ✔ | ✔ |
subtle.sign(algorithm, key, data)
#>
-
algorithm
<string> | <RsaPssParams> | <EcdsaParams> | <Ed448Params> -
key
<CryptoKey> -
data
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
使用 algorithm
给出的方法和参数以及 key
提供的密钥材料,subtle.sign()
尝试生成 data
的加密签名。如果成功,返回的 promise 将使用包含生成的签名的 <ArrayBuffer> 进行解析。
¥Using the method and parameters given by algorithm
and the keying material
provided by key
, subtle.sign()
attempts to generate a cryptographic
signature of data
. If successful, the returned promise is resolved with
an <ArrayBuffer> containing the generated signature.
目前支持的算法包括:
¥The algorithms currently supported include:
-
'ECDSA'
-
'Ed25519'
-
'Ed448'
4 -
'HMAC'
-
'ML-DSA-44'
3 -
'ML-DSA-65'
3 -
'ML-DSA-87'
3 -
'RSA-PSS'
-
'RSASSA-PKCS1-v1_5'
subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)
#>
-
format
<string> 必须是'raw'
、'pkcs8'
、'spki'
、'jwk'
、'raw-secret'
3、'raw-public'
3 或'raw-seed'
3 之一。¥
format
<string> Must be one of'raw'
,'pkcs8'
,'spki'
,'jwk'
,'raw-secret'
3,'raw-public'
3, or'raw-seed'
3. -
wrappedKey
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
unwrappingKey
<CryptoKey>
-
unwrapAlgo
<string> | <RsaOaepParams> | <AesCtrParams> | <AesCbcParams> -
unwrappedKeyAlgo
<string> | <RsaHashedImportParams> | <EcKeyImportParams> | <HmacImportParams>
-
extractable
<boolean> -
keyUsages
<string[]> 参见 关键用法。¥
keyUsages
<string[]> See Key usages. -
返回:<Promise> 成功后获得 <CryptoKey>。
¥Returns: <Promise> Fulfills with a <CryptoKey> upon success.
在密码学中,"封装密钥" 指的是导出然后加密密钥材料。subtle.unwrapKey()
方法尝试解密封装密钥并创建 <CryptoKey> 实例。它等效于首先对加密密钥数据调用 subtle.decrypt()
(使用 wrappedKey
、unwrapAlgo
和 unwrappingKey
参数作为输入),然后使用 unwrappedKeyAlgo
、extractable
和 keyUsages
参数作为输入将结果传递给 subtle.importKey()
方法。如果成功,返回的 promise 将使用 <CryptoKey> 对象解析。
¥In cryptography, "wrapping a key" refers to exporting and then encrypting the
keying material. The subtle.unwrapKey()
method attempts to decrypt a wrapped
key and create a <CryptoKey> instance. It is equivalent to calling
subtle.decrypt()
first on the encrypted key data (using the wrappedKey
,
unwrapAlgo
, and unwrappingKey
arguments as input) then passing the results
in to the subtle.importKey()
method using the unwrappedKeyAlgo
,
extractable
, and keyUsages
arguments as inputs. If successful, the returned
promise is resolved with a <CryptoKey> object.
目前支持的环绕算法包括:
¥The wrapping algorithms currently supported include:
支持的解包密钥算法包括:
¥The unwrapped key algorithms supported include:
-
'AES-CBC'
-
'AES-CTR'
-
'AES-GCM'
-
'AES-KW'
-
'AES-OCB'
3 -
'ChaCha20-Poly1305'
3 -
'ECDH'
-
'ECDSA'
-
'Ed25519'
-
'Ed448'
4 -
'HMAC'
-
'ML-DSA-44'
3 -
'ML-DSA-65'
3 -
'ML-DSA-87'
3 -
'ML-KEM-512'
3 -
'ML-KEM-768'
3 -
'ML-KEM-1024'
3v -
'RSA-OAEP'
-
'RSA-PSS'
-
'RSASSA-PKCS1-v1_5'
-
'X25519'
-
'X448'
4
subtle.verify(algorithm, key, signature, data)
#>
-
algorithm
<string> | <RsaPssParams> | <EcdsaParams> | <Ed448Params> -
key
<CryptoKey> -
signature
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> -
data
<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
使用 algorithm
中给出的方法和参数以及 key
提供的密钥材料,subtle.verify()
尝试验证 signature
是 data
的有效密码签名。返回的 promise 通过 true
或 false
解决。
¥Using the method and parameters given in algorithm
and the keying material
provided by key
, subtle.verify()
attempts to verify that signature
is
a valid cryptographic signature of data
. The returned promise is resolved
with either true
or false
.
目前支持的算法包括:
¥The algorithms currently supported include:
-
'ECDSA'
-
'Ed25519'
-
'Ed448'
4 -
'HMAC'
-
'ML-DSA-44'
3 -
'ML-DSA-65'
3 -
'ML-DSA-87'
3 -
'RSA-PSS'
-
'RSASSA-PKCS1-v1_5'
subtle.wrapKey(format, key, wrappingKey, wrapAlgo)
#>
-
format
<string> 必须是'raw'
、'pkcs8'
、'spki'
、'jwk'
、'raw-secret'
3、'raw-public'
3 或'raw-seed'
3 之一。¥
format
<string> Must be one of'raw'
,'pkcs8'
,'spki'
,'jwk'
,'raw-secret'
3,'raw-public'
3, or'raw-seed'
3. -
key
<CryptoKey> -
wrappingKey
<CryptoKey> -
wrapAlgo
<string> | <RsaOaepParams> | <AesCtrParams> | <AesCbcParams> -
返回:<Promise> 成功后使用 <ArrayBuffer> 完成。
¥Returns: <Promise> Fulfills with an <ArrayBuffer> upon success.
在密码学中,"封装密钥" 指的是导出然后加密密钥材料。subtle.wrapKey()
方法将密钥材料导出为 format
标识的格式,然后使用 wrapAlgo
指定的方法和参数以及 wrappingKey
提供的密钥材料对其进行加密。它相当于使用 format
和 key
作为参数调用 subtle.exportKey()
,然后将结果传递给使用 wrappingKey
和 wrapAlgo
作为输入的 subtle.encrypt()
方法。如果成功,将使用包含加密密钥数据的 <ArrayBuffer> 解析返回的 promise。
¥In cryptography, "wrapping a key" refers to exporting and then encrypting the
keying material. The subtle.wrapKey()
method exports the keying material into
the format identified by format
, then encrypts it using the method and
parameters specified by wrapAlgo
and the keying material provided by
wrappingKey
. It is the equivalent to calling subtle.exportKey()
using
format
and key
as the arguments, then passing the result to the
subtle.encrypt()
method using wrappingKey
and wrapAlgo
as inputs. If
successful, the returned promise will be resolved with an <ArrayBuffer>
containing the encrypted key data.
目前支持的环绕算法包括:
¥The wrapping algorithms currently supported include:
算法参数#>
¥Algorithm parameters
算法参数对象定义了各种 <SubtleCrypto> 方法使用的方法和参数。虽然这里描述为 "classes",但它们是简单的 JavaScript 字典对象。
¥The algorithm parameter objects define the methods and parameters used by the various <SubtleCrypto> methods. While described here as "classes", they are simple JavaScript dictionary objects.
类:Algorithm
#>
¥Class: Algorithm
Algorithm.name
#>
类:AeadParams
#>
¥Class: AeadParams
aeadParams.additionalData
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
未加密但包含在数据身份验证中的额外输入。additionalData
的使用是可选的。
¥Extra input that is not encrypted but is included in the authentication
of the data. The use of additionalData
is optional.
aeadParams.iv
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
对于使用给定密钥的每个加密操作,初始化向量必须是唯一的。
¥The initialization vector must be unique for every encryption operation using a given key.
aeadParams.name
#>
-
类型:<string> 必须是
'AES-GCM'
、'AES-OCB'
或'ChaCha20-Poly1305'
。¥Type: <string> Must be
'AES-GCM'
,'AES-OCB'
, or'ChaCha20-Poly1305'
.
aeadParams.tagLength
#>
-
类型:<number> 生成的身份验证标记的大小(以位为单位)。
¥Type: <number> The size in bits of the generated authentication tag.
类:AesDerivedKeyParams
#>
¥Class: AesDerivedKeyParams
aesDerivedKeyParams.name
#>
-
类型:<string> 必须是
'AES-CBC'
、'AES-CTR'
、'AES-GCM'
、'AES-OCB'
或'AES-KW'
之一¥Type: <string> Must be one of
'AES-CBC'
,'AES-CTR'
,'AES-GCM'
,'AES-OCB'
, or'AES-KW'
aesDerivedKeyParams.length
#>
要派生的 AES 密钥的长度。这必须是 128
、192
或 256
。
¥The length of the AES key to be derived. This must be either 128
, 192
,
or 256
.
类:AesCbcParams
#>
¥Class: AesCbcParams
aesCbcParams.iv
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
提供初始化向量。它的长度必须恰好为 16 个字节,并且应该是不可预测的并且在密码学上是随机的。
¥Provides the initialization vector. It must be exactly 16-bytes in length and should be unpredictable and cryptographically random.
aesCbcParams.name
#>
类:AesCtrParams
#>
¥Class: AesCtrParams
aesCtrParams.counter
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
计数器块的初始值。这必须正好是 16 个字节长。
¥The initial value of the counter block. This must be exactly 16 bytes long.
AES-CTR
方法使用块的最右边的 length
位作为计数器,其余位作为随机数。
¥The AES-CTR
method uses the rightmost length
bits of the block as the
counter and the remaining bits as the nonce.
aesCtrParams.length
#>
-
类型:<number>
aesCtrParams.counter
中用作计数器的位数。¥Type: <number> The number of bits in the
aesCtrParams.counter
that are to be used as the counter.
aesCtrParams.name
#>
类:AesKeyAlgorithm
#>
¥Class: AesKeyAlgorithm
aesKeyAlgorithm.length
#>
AES 密钥的长度(以位为单位)。
¥The length of the AES key in bits.
aesKeyAlgorithm.name
#>
类:AesKeyGenParams
#>
¥Class: AesKeyGenParams
aesKeyGenParams.length
#>
要生成的 AES 密钥的长度。这必须是 128
、192
或 256
。
¥The length of the AES key to be generated. This must be either 128
, 192
,
or 256
.
aesKeyGenParams.name
#>
-
类型:<string> 必须是
'AES-CBC'
、'AES-CTR'
、'AES-GCM'
或'AES-KW'
之一¥Type: <string> Must be one of
'AES-CBC'
,'AES-CTR'
,'AES-GCM'
, or'AES-KW'
类:ContextParams
#>
¥Class: ContextParams
contextParams.name
#>
-
类型:<string> 必须是
'ML-DSA-44'
3、'ML-DSA-65'
3 或'ML-DSA-87'
3。¥Type: <string> Must be
'ML-DSA-44'
3,'ML-DSA-65'
3, or'ML-DSA-87'
3.
contextParams.context
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
context
成员表示与消息关联的可选上下文数据。Node.js Web Crypto API 实现仅支持零长度上下文,相当于根本不提供上下文。
¥The context
member represents the optional context data to associate with
the message.
The Node.js Web Crypto API implementation only supports zero-length context
which is equivalent to not providing context at all.
类:CShakeParams
#>
¥Class: CShakeParams
cShakeParams.customization
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
customization
成员表示自定义字符串。Node.js Web Crypto API 实现仅支持零长度自定义,这相当于完全不提供自定义。
¥The customization
member represents the customization string.
The Node.js Web Crypto API implementation only supports zero-length customization
which is equivalent to not providing customization at all.
cShakeParams.functionName
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
functionName
成员表示函数名称,NIST 使用它来定义基于 cSHAKE 的函数。Node.js Web Crypto API 实现仅支持零长度的 functionName,这相当于根本不提供 functionName。
¥The functionName
member represents represents the function name, used by NIST to define
functions based on cSHAKE.
The Node.js Web Crypto API implementation only supports zero-length functionName
which is equivalent to not providing functionName at all.
cShakeParams.length
#>
cShakeParams.name
#>
类:EcdhKeyDeriveParams
#>
¥Class: EcdhKeyDeriveParams
ecdhKeyDeriveParams.name
#>
ecdhKeyDeriveParams.public
#>
-
类型:<CryptoKey>
¥Type: <CryptoKey>
ECDH 密钥派生通过将一方的私钥和另一方的公钥作为输入来运行 - 使用两者来生成一个共同的共享秘密。ecdhKeyDeriveParams.public
属性设置为其他方的公钥。
¥ECDH key derivation operates by taking as input one parties private key and
another parties public key -- using both to generate a common shared secret.
The ecdhKeyDeriveParams.public
property is set to the other parties public
key.
类:EcdsaParams
#>
¥Class: EcdsaParams
ecdsaParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
ecdsaParams.name
#>
类:EcKeyAlgorithm
#>
¥Class: EcKeyAlgorithm
ecKeyAlgorithm.name
#>
ecKeyAlgorithm.namedCurve
#>
类:EcKeyGenParams
#>
¥Class: EcKeyGenParams
ecKeyGenParams.name
#>
ecKeyGenParams.namedCurve
#>
-
类型:<string> 必须是
'P-256'
、'P-384'
、'P-521'
之一。¥Type: <string> Must be one of
'P-256'
,'P-384'
,'P-521'
.
类:EcKeyImportParams
#>
¥Class: EcKeyImportParams
ecKeyImportParams.name
#>
ecKeyImportParams.namedCurve
#>
-
类型:<string> 必须是
'P-256'
、'P-384'
、'P-521'
之一。¥Type: <string> Must be one of
'P-256'
,'P-384'
,'P-521'
.
类:Ed448Params
#>
¥Class: Ed448Params
ed448Params.name
#>
ed448Params.context
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer> | <undefined>
context
成员表示与消息关联的可选上下文数据。Node.js Web Crypto API 实现仅支持零长度上下文,相当于根本不提供上下文。
¥The context
member represents the optional context data to associate with
the message.
The Node.js Web Crypto API implementation only supports zero-length context
which is equivalent to not providing context at all.
类:EncapsulatedBits
#>
¥Class: EncapsulatedBits
encapsulatedBits.ciphertext
#>
-
¥Type: <ArrayBuffer>
encapsulatedBits.sharedKey
#>
-
¥Type: <ArrayBuffer>
类:EncapsulatedKey
#>
¥Class: EncapsulatedKey
encapsulatedKey.ciphertext
#>
-
¥Type: <ArrayBuffer>
encapsulatedKey.sharedKey
#>
-
类型:<CryptoKey>
¥Type: <CryptoKey>
类:HkdfParams
#>
¥Class: HkdfParams
hkdfParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
hkdfParams.info
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
为 HKDF 算法提供特定于应用的上下文输入。这可以是零长度,但必须提供。
¥Provides application-specific contextual input to the HKDF algorithm. This can be zero-length but must be provided.
hkdfParams.name
#>
hkdfParams.salt
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
盐值显着提高了 HKDF 算法的强度。它应该是随机的或伪随机的,并且应该与摘要函数的输出长度相同(例如,如果使用 'SHA-256'
作为摘要,盐应该是 256 位的随机数据)。
¥The salt value significantly improves the strength of the HKDF algorithm.
It should be random or pseudorandom and should be the same length as the
output of the digest function (for instance, if using 'SHA-256'
as the
digest, the salt should be 256-bits of random data).
类:HmacImportParams
#>
¥Class: HmacImportParams
hmacImportParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
hmacImportParams.length
#>
HMAC 密钥中的可选位数。这是可选的,在大多数情况下应该省略。
¥The optional number of bits in the HMAC key. This is optional and should be omitted for most cases.
hmacImportParams.name
#>
类:HmacKeyAlgorithm
#>
¥Class: HmacKeyAlgorithm
hmacKeyAlgorithm.hash
#>
-
类型:Algorithm
¥Type: Algorithm
hmacKeyAlgorithm.length
#>
HMAC 密钥的长度(以位为单位)。
¥The length of the HMAC key in bits.
hmacKeyAlgorithm.name
#>
类:HmacKeyGenParams
#>
¥Class: HmacKeyGenParams
hmacKeyGenParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
hmacKeyGenParams.length
#>
为 HMAC 密钥生成的位数。如果省略,长度将由使用的散列算法确定。这是可选的,在大多数情况下应该省略。
¥The number of bits to generate for the HMAC key. If omitted, the length will be determined by the hash algorithm used. This is optional and should be omitted for most cases.
hmacKeyGenParams.name
#>
类:KeyAlgorithm
#>
¥Class: KeyAlgorithm
keyAlgorithm.name
#>
类:Pbkdf2Params
#>
¥Class: Pbkdf2Params
pbkdf2Params.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
pbkdf2Params.iterations
#>
PBKDF2 算法在导出位时应进行的迭代次数。
¥The number of iterations the PBKDF2 algorithm should make when deriving bits.
pbkdf2Params.name
#>
pbkdf2Params.salt
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
应至少为 16 个随机或伪随机字节。
¥Should be at least 16 random or pseudorandom bytes.
类:RsaHashedImportParams
#>
¥Class: RsaHashedImportParams
rsaHashedImportParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
rsaHashedImportParams.name
#>
-
类型:<string> 必须是
'RSASSA-PKCS1-v1_5'
、'RSA-PSS'
或'RSA-OAEP'
之一。¥Type: <string> Must be one of
'RSASSA-PKCS1-v1_5'
,'RSA-PSS'
, or'RSA-OAEP'
.
类:RsaHashedKeyAlgorithm
#>
¥Class: RsaHashedKeyAlgorithm
rsaHashedKeyAlgorithm.hash
#>
-
类型:Algorithm
¥Type: Algorithm
rsaHashedKeyAlgorithm.modulusLength
#>
RSA 模数的长度(以位为单位)。
¥The length in bits of the RSA modulus.
rsaHashedKeyAlgorithm.name
#>
rsaHashedKeyAlgorithm.publicExponent
#>
-
类型:<Uint8Array>
¥Type: <Uint8Array>
RSA 公共指数。
¥The RSA public exponent.
类:RsaHashedKeyGenParams
#>
¥Class: RsaHashedKeyGenParams
rsaHashedKeyGenParams.hash
#>
如果表示为 <string>,则该值必须是以下之一:
¥If represented as a <string>, the value must be one of:
如果表示为 Algorithm,则对象的 name
属性必须是上述值之一。
¥If represented as an Algorithm, the object's name
property
must be one of the above listed values.
rsaHashedKeyGenParams.modulusLength
#>
RSA 模数的长度(以位为单位)。作为最佳实践,这至少应为 2048
。
¥The length in bits of the RSA modulus. As a best practice, this should be
at least 2048
.
rsaHashedKeyGenParams.name
#>
-
类型:<string> 必须是
'RSASSA-PKCS1-v1_5'
、'RSA-PSS'
或'RSA-OAEP'
之一。¥Type: <string> Must be one of
'RSASSA-PKCS1-v1_5'
,'RSA-PSS'
, or'RSA-OAEP'
.
rsaHashedKeyGenParams.publicExponent
#>
-
类型:<Uint8Array>
¥Type: <Uint8Array>
RSA 公共指数。这必须是一个 <Uint8Array>,其中包含一个必须适合 32 位的大端无符号整数。<Uint8Array> 可以包含任意数量的前导零位。该值必须是质数。除非有理由使用不同的值,否则使用 new Uint8Array([1, 0, 1])
(65537) 作为公共指数。
¥The RSA public exponent. This must be a <Uint8Array> containing a big-endian,
unsigned integer that must fit within 32-bits. The <Uint8Array> may contain an
arbitrary number of leading zero-bits. The value must be a prime number. Unless
there is reason to use a different value, use new Uint8Array([1, 0, 1])
(65537) as the public exponent.
类:RsaOaepParams
#>
¥Class: RsaOaepParams
rsaOaepParams.label
#>
-
类型:<ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
¥Type: <ArrayBuffer> | <TypedArray> | <DataView> | <Buffer>
不会加密但会绑定到生成的密文的额外字节集合。
¥An additional collection of bytes that will not be encrypted, but will be bound to the generated ciphertext.
rsaOaepParams.label
参数是可选的。
¥The rsaOaepParams.label
parameter is optional.
rsaOaepParams.name
#>
类:RsaPssParams
#>
¥Class: RsaPssParams
rsaPssParams.name
#>
rsaPssParams.saltLength
#>
要使用的随机盐的长度(以字节为单位)。
¥The length (in bytes) of the random salt to use.
Footnotes
-
需要 OpenSSL >= 3.0
¥Requires OpenSSL >= 3.0 ↩
-
需要 OpenSSL >= 3.5
-
¥See Modern Algorithms in the Web Cryptography API ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14 ↩15 ↩16 ↩17 ↩18 ↩19 ↩20 ↩21 ↩22 ↩23 ↩24 ↩25 ↩26 ↩27 ↩28 ↩29 ↩30 ↩31 ↩32 ↩33 ↩34 ↩35 ↩36 ↩37 ↩38 ↩39 ↩40 ↩41 ↩42 ↩43 ↩44 ↩45 ↩46 ↩47 ↩48 ↩49 ↩50 ↩51 ↩52 ↩53 ↩54 ↩55 ↩56 ↩57 ↩58 ↩59 ↩60 ↩61 ↩62 ↩63 ↩64 ↩65 ↩66 ↩67 ↩68 ↩69 ↩70 ↩71 ↩72 ↩73 ↩74 ↩75 ↩76 ↩77 ↩78 ↩79 ↩80 ↩81 ↩82 ↩83 ↩84 ↩85 ↩86 ↩87 ↩88 ↩89 ↩90 ↩91 ↩92 ↩93 ↩94 ↩95 ↩96 ↩97 ↩98 ↩99 ↩100 ↩101 ↩102
-
参见 Web Cryptography API 中的安全曲线
¥See Secure Curves in the Web Cryptography API ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13 ↩14