From 9fcfef09ac0676bd116f57b026a52d4627ca9e35 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 15 Oct 2021 21:45:45 -0700 Subject: [PATCH] doc: use GFM footnotes in webcrypto.md PR-URL: https://github.com/nodejs/node/pull/40477 Reviewed-By: Antoine du Hamel --- doc/api/webcrypto.md | 220 ++++++++++++++++++++----------------------- 1 file changed, 101 insertions(+), 119 deletions(-) diff --git a/doc/api/webcrypto.md b/doc/api/webcrypto.md index 0a860d74470d78..db657a6222d5c5 100644 --- a/doc/api/webcrypto.md +++ b/doc/api/webcrypto.md @@ -306,30 +306,28 @@ async function digest(data, algorithm = 'SHA-512') { The table details the algorithms supported by the Node.js Web Crypto API implementation and the APIs supported for each: -| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | -| ---------------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | -| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | -| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | -| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | -| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | -| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | -| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | -| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | -| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | -| `'SHA-1'` | | | | | | | | | | | | ✔ | -| `'SHA-256'` | | | | | | | | | | | | ✔ | -| `'SHA-384'` | | | | | | | | | | | | ✔ | -| `'SHA-512'` | | | | | | | | | | | | ✔ | -| `'NODE-DSA'`1 | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'NODE-DH'`1 | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | -| `'NODE-ED25519'`1 | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | -| `'NODE-ED448'`1 | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | - -1 Node.js-specific extension +| Algorithm | `generateKey` | `exportKey` | `importKey` | `encrypt` | `decrypt` | `wrapKey` | `unwrapKey` | `deriveBits` | `deriveKey` | `sign` | `verify` | `digest` | +| --------------------- | ------------- | ----------- | ----------- | --------- | --------- | --------- | ----------- | ------------ | ----------- | ------ | -------- | -------- | +| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'RSA-PSS'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'RSA-OAEP'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | +| `'ECDSA'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'ECDH'` | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | +| `'AES-CTR'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | +| `'AES-CBC'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | +| `'AES-GCM'` | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | | | | | +| `'AES-KW'` | ✔ | ✔ | ✔ | | | ✔ | ✔ | | | | | | +| `'HMAC'` | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'HKDF'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | +| `'PBKDF2'` | | ✔ | ✔ | | | | | ✔ | ✔ | | | | +| `'SHA-1'` | | | | | | | | | | | | ✔ | +| `'SHA-256'` | | | | | | | | | | | | ✔ | +| `'SHA-384'` | | | | | | | | | | | | ✔ | +| `'SHA-512'` | | | | | | | | | | | | ✔ | +| `'NODE-DSA'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'NODE-DH'`[^1] | ✔ | ✔ | ✔ | | | | | ✔ | ✔ | | | | +| `'NODE-ED25519'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | +| `'NODE-ED448'`[^1] | ✔ | ✔ | ✔ | | | | | | | ✔ | ✔ | | ## Class: `Crypto` @@ -447,27 +445,25 @@ The possible usages are: 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'` | | | | | ✔ | ✔ | | | -| `'ECDSA'` | | | ✔ | ✔ | | | | | -| `'HDKF'` | | | | | ✔ | ✔ | | | -| `'HMAC'` | | | ✔ | ✔ | | | | | -| `'PBKDF2'` | | | | | ✔ | ✔ | | | -| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | -| `'RSA-PSS'` | | | ✔ | ✔ | | | | | -| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | -| `'NODE-DSA'` 1 | | | ✔ | ✔ | | | | | -| `'NODE-DH'` 1 | | | | | ✔ | ✔ | | | -| `'NODE-SCRYPT'` 1 | | | | | ✔ | ✔ | | | -| `'NODE-ED25519'` 1 | | | ✔ | ✔ | | | | | -| `'NODE-ED448'` 1 | | | ✔ | ✔ | | | | | - -1 Node.js-specific extension. +| Key Type | `'encrypt'` | `'decrypt'` | `'sign'` | `'verify'` | `'deriveKey'` | `'deriveBits'` | `'wrapKey'` | `'unwrapKey'` | +| --------------------- | ----------- | ----------- | -------- | ---------- | ------------- | -------------- | ----------- | ------------- | +| `'AES-CBC'` | ✔ | ✔ | | | | | ✔ | ✔ | +| `'AES-CTR'` | ✔ | ✔ | | | | | ✔ | ✔ | +| `'AES-GCM'` | ✔ | ✔ | | | | | ✔ | ✔ | +| `'AES-KW'` | | | | | | | ✔ | ✔ | +| `'ECDH'` | | | | | ✔ | ✔ | | | +| `'ECDSA'` | | | ✔ | ✔ | | | | | +| `'HDKF'` | | | | | ✔ | ✔ | | | +| `'HMAC'` | | | ✔ | ✔ | | | | | +| `'PBKDF2'` | | | | | ✔ | ✔ | | | +| `'RSA-OAEP'` | ✔ | ✔ | | | | | ✔ | ✔ | +| `'RSA-PSS'` | | | ✔ | ✔ | | | | | +| `'RSASSA-PKCS1-v1_5'` | | | ✔ | ✔ | | | | | +| `'NODE-DSA'`[^1] | | | ✔ | ✔ | | | | | +| `'NODE-DH'`[^1] | | | | | ✔ | ✔ | | | +| `'NODE-SCRYPT'`[^1] | | | | | ✔ | ✔ | | | +| `'NODE-ED25519'`[^1] | | | ✔ | ✔ | | | | | +| `'NODE-ED448'`[^1] | | | ✔ | ✔ | | | | | ## Class: `CryptoKeyPair` @@ -549,10 +545,8 @@ The algorithms currently supported include: * `'ECDH'` * `'HKDF'` * `'PBKDF2'` -* `'NODE-DH'`1 -* `'NODE-SCRYPT'`1 - -1 Node.js-specific extension +* `'NODE-DH'`[^1] +* `'NODE-SCRYPT'`[^1] ### `subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)` @@ -585,10 +579,8 @@ The algorithms currently supported include: * `'ECDH'` * `'HKDF'` * `'PBKDF2'` -* `'NODE-DH'`1 -* '`NODE-SCRYPT'`1 - -1 Node.js-specific extension +* `'NODE-DH'`[^1] +* '`NODE-SCRYPT'`[^1] ### `subtle.digest(algorithm, data)` @@ -667,27 +659,25 @@ specification. The special `'node.keyObject'` value for `format` is a Node.js-specific extension that allows converting a {CryptoKey} into a Node.js {KeyObject}. -| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | -| ----------------------------- | -------- | --------- | ------- | ------- | -| `'AES-CBC'` | | | ✔ | ✔ | -| `'AES-CTR'` | | | ✔ | ✔ | -| `'AES-GCM'` | | | ✔ | ✔ | -| `'AES-KW'` | | | ✔ | ✔ | -| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | -| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | -| `'HDKF'` | | | | | -| `'HMAC'` | | | ✔ | ✔ | -| `'PBKDF2'` | | | | | -| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | -| `'RSA-PSS'` | ✔ | ✔ | ✔ | | -| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | -| `'NODE-DSA'` 1 | ✔ | ✔ | | | -| `'NODE-DH'` 1 | ✔ | ✔ | | | -| `'NODE-SCRYPT'` 1 | | | | | -| `'NODE-ED25519'` 1 | ✔ | ✔ | ✔ | ✔ | -| `'NODE-ED448'` 1 | ✔ | ✔ | ✔ | ✔ | - -1 Node.js-specific extension +| Key Type | `'spki'` | `'pkcs8'` | `'jwk'` | `'raw'` | +| --------------------- | -------- | --------- | ------- | ------- | +| `'AES-CBC'` | | | ✔ | ✔ | +| `'AES-CTR'` | | | ✔ | ✔ | +| `'AES-GCM'` | | | ✔ | ✔ | +| `'AES-KW'` | | | ✔ | ✔ | +| `'ECDH'` | ✔ | ✔ | ✔ | ✔ | +| `'ECDSA'` | ✔ | ✔ | ✔ | ✔ | +| `'HDKF'` | | | | | +| `'HMAC'` | | | ✔ | ✔ | +| `'PBKDF2'` | | | | | +| `'RSA-OAEP'` | ✔ | ✔ | ✔ | | +| `'RSA-PSS'` | ✔ | ✔ | ✔ | | +| `'RSASSA-PKCS1-v1_5'` | ✔ | ✔ | ✔ | | +| `'NODE-DSA'`[^1] | ✔ | ✔ | | | +| `'NODE-DH'`[^1] | ✔ | ✔ | | | +| `'NODE-SCRYPT'`[^1] | | | | | +| `'NODE-ED25519'`[^1] | ✔ | ✔ | ✔ | ✔ | +| `'NODE-ED448'`[^1] | ✔ | ✔ | ✔ | ✔ | ### `subtle.generateKey(algorithm, extractable, keyUsages)` @@ -717,10 +707,10 @@ include: * `'RSA-OAEP'` * `'ECDSA'` * `'ECDH'` -* `'NODE-DSA'` 1 -* `'NODE-DH'` 1 -* `'NODE-ED25519'` 1 -* `'NODE-ED448'` 1 +* `'NODE-DSA'`[^1] +* `'NODE-DH'`[^1] +* `'NODE-ED25519'`[^1] +* `'NODE-ED448'`[^1] The {CryptoKey} (secret key) generating algorithms supported include: @@ -730,8 +720,6 @@ The {CryptoKey} (secret key) generating algorithms supported include: * `'AES-GCM'` * `'AES-KW'` -1 Non-standard Node.js extension - ### `subtle.importKey(format, keyData, algorithm, extractable, keyUsages)`