| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 56bdd87 commit 1a4edb3
10 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -848,7 +848,7 @@ The algorithms currently supported include: | |||
| 848 | 848 | * `'ML-KEM-768'`[^modern-algos] | |
| 849 | 849 | * `'ML-KEM-1024'`[^modern-algos] | |
| 850 | 850 | ||
| 851 | - ### `subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, usages)` | ||
| 851 | + ### `subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, keyUsages)` | ||
| 852 | 852 | ||
| 853 | 853 | <!-- YAML | |
| 854 | 854 | added: v24.7.0 | |
@@ -861,7 +861,7 @@ added: v24.7.0 | |||
| 861 | 861 | * `ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer} | |
| 862 | 862 | * `sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} | |
| 863 | 863 | * `extractable` {boolean} | |
| 864 | - * `usages` {string\[]} See [Key usages][]. | ||
| 864 | + * `keyUsages` {string\[]} See [Key usages][]. | ||
| 865 | 865 | * Returns: {Promise} Fulfills with {CryptoKey} upon success. | |
| 866 | 866 | ||
| 867 | 867 | A message recipient uses their asymmetric private key to decrypt an | |
@@ -959,7 +959,7 @@ The algorithms currently supported include: | |||
| 959 | 959 | * `'X25519'` | |
| 960 | 960 | * `'X448'`[^secure-curves] | |
| 961 | 961 | ||
| 962 | - ### `subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)` | ||
| 962 | + ### `subtle.deriveKey(algorithm, baseKey, derivedKeyType, extractable, keyUsages)` | ||
| 963 | 963 | ||
| 964 | 964 | <!-- YAML | |
| 965 | 965 | added: v15.0.0 | |
@@ -978,7 +978,7 @@ changes: | |||
| 978 | 978 | ||
| 979 | 979 | * `algorithm` {EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params|Argon2Params} | |
| 980 | 980 | * `baseKey` {CryptoKey} | |
| 981 | - * `derivedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} | ||
| 981 | + * `derivedKeyType` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} | ||
| 982 | 982 | * `extractable` {boolean} | |
| 983 | 983 | * `keyUsages` {string\[]} See [Key usages][]. | |
| 984 | 984 | * Returns: {Promise} Fulfills with a {CryptoKey} upon success. | |
@@ -987,11 +987,11 @@ changes: | |||
| 987 | 987 | ||
| 988 | 988 | Using the method and parameters specified in `algorithm`, and the keying | |
| 989 | 989 | material provided by `baseKey`, this method attempts to generate | |
| 990 | - a new {CryptoKey} based on the method and parameters in `derivedKeyAlgorithm`. | ||
| 990 | + a new {CryptoKey} based on the method and parameters in `derivedKeyType`. | ||
| 991 | 991 | ||
| 992 | 992 | Calling this method is equivalent to calling [`subtle.deriveBits()`][] to | |
| 993 | 993 | generate raw keying material, then passing the result into the | |
| 994 | - [`subtle.importKey()`][] method using the `derivedKeyAlgorithm`, `extractable`, and | ||
| 994 | + [`subtle.importKey()`][] method using the `derivedKeyType`, `extractable`, and | ||
| 995 | 995 | `keyUsages` parameters as input. | |
| 996 | 996 | ||
| 997 | 997 | The algorithms currently supported include: | |
@@ -1070,7 +1070,7 @@ The algorithms currently supported include: | |||
| 1070 | 1070 | * `'ML-KEM-768'`[^modern-algos] | |
| 1071 | 1071 | * `'ML-KEM-1024'`[^modern-algos] | |
| 1072 | 1072 | ||
| 1073 | - ### `subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, usages)` | ||
| 1073 | + ### `subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, keyUsages)` | ||
| 1074 | 1074 | ||
| 1075 | 1075 | <!-- YAML | |
| 1076 | 1076 | added: v24.7.0 | |
@@ -1082,7 +1082,7 @@ added: v24.7.0 | |||
| 1082 | 1082 | * `encapsulationKey` {CryptoKey} | |
| 1083 | 1083 | * `sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams|KmacImportParams} | |
| 1084 | 1084 | * `extractable` {boolean} | |
| 1085 | - * `usages` {string\[]} See [Key usages][]. | ||
| 1085 | + * `keyUsages` {string\[]} See [Key usages][]. | ||
| 1086 | 1086 | * Returns: {Promise} Fulfills with {EncapsulatedKey} upon success. | |
| 1087 | 1087 | ||
| 1088 | 1088 | Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key. | |
@@ -1414,7 +1414,7 @@ The algorithms currently supported include: | |||
| 1414 | 1414 | * `'RSA-PSS'` | |
| 1415 | 1415 | * `'RSASSA-PKCS1-v1_5'` | |
| 1416 | 1416 | ||
| 1417 | - ### `subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)` | ||
| 1417 | + ### `subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages)` | ||
| 1418 | 1418 | ||
| 1419 | 1419 | <!-- YAML | |
| 1420 | 1420 | added: v15.0.0 | |
@@ -1434,8 +1434,8 @@ changes: | |||
| 1434 | 1434 | ||
| 1435 | 1435 | <!--lint disable maximum-line-length remark-lint--> | |
| 1436 | 1436 | ||
| 1437 | - * `unwrapAlgo` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} | ||
| 1438 | - * `unwrappedKeyAlgo` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|KmacImportParams} | ||
| 1437 | + * `unwrapAlgorithm` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} | ||
| 1438 | + * `unwrappedKeyAlgorithm` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams|KmacImportParams} | ||
| 1439 | 1439 | ||
| 1440 | 1440 | <!--lint enable maximum-line-length remark-lint--> | |
| 1441 | 1441 | ||
@@ -1447,8 +1447,8 @@ In cryptography, "wrapping a key" refers to exporting and then encrypting the | |||
| 1447 | 1447 | keying material. This method attempts to decrypt a wrapped | |
| 1448 | 1448 | key and create a {CryptoKey} instance. It is equivalent to calling | |
| 1449 | 1449 | [`subtle.decrypt()`][] first on the encrypted key data (using the `wrappedKey`, | |
| 1450 | - `unwrapAlgo`, and `unwrappingKey` arguments as input) then passing the results | ||
| 1451 | - to the [`subtle.importKey()`][] method using the `unwrappedKeyAlgo`, | ||
| 1450 | + `unwrapAlgorithm`, and `unwrappingKey` arguments as input) then passing the results | ||
| 1451 | + to the [`subtle.importKey()`][] method using the `unwrappedKeyAlgorithm`, | ||
| 1452 | 1452 | `extractable`, and `keyUsages` arguments as inputs. If successful, the returned | |
| 1453 | 1453 | promise is resolved with a {CryptoKey} object. | |
| 1454 | 1454 | ||
@@ -1536,7 +1536,7 @@ The algorithms currently supported include: | |||
| 1536 | 1536 | * `'RSA-PSS'` | |
| 1537 | 1537 | * `'RSASSA-PKCS1-v1_5'` | |
| 1538 | 1538 | ||
| 1539 | - ### `subtle.wrapKey(format, key, wrappingKey, wrapAlgo)` | ||
| 1539 | + ### `subtle.wrapKey(format, key, wrappingKey, wrapAlgorithm)` | ||
| 1540 | 1540 | ||
| 1541 | 1541 | <!-- YAML | |
| 1542 | 1542 | added: v15.0.0 | |
@@ -1555,18 +1555,18 @@ changes: | |||
| 1555 | 1555 | `'raw-public'`[^modern-algos], or `'raw-seed'`[^modern-algos]. | |
| 1556 | 1556 | * `key` {CryptoKey} | |
| 1557 | 1557 | * `wrappingKey` {CryptoKey} | |
| 1558 | - * `wrapAlgo` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} | ||
| 1558 | + * `wrapAlgorithm` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams|AeadParams} | ||
| 1559 | 1559 | * Returns: {Promise} Fulfills with an {ArrayBuffer} upon success. | |
| 1560 | 1560 | ||
| 1561 | 1561 | <!--lint enable maximum-line-length remark-lint--> | |
| 1562 | 1562 | ||
| 1563 | 1563 | In cryptography, "wrapping a key" refers to exporting and then encrypting the | |
| 1564 | 1564 | keying material. This method exports the keying material into | |
| 1565 | 1565 | the format identified by `format`, then encrypts it using the method and | |
| 1566 | - parameters specified by `wrapAlgo` and the keying material provided by | ||
| 1566 | + parameters specified by `wrapAlgorithm` and the keying material provided by | ||
| 1567 | 1567 | `wrappingKey`. It is the equivalent to calling [`subtle.exportKey()`][] using | |
| 1568 | 1568 | `format` and `key` as the arguments, then passing the result to the | |
| 1569 | - [`subtle.encrypt()`][] method using `wrappingKey` and `wrapAlgo` as inputs. If | ||
| 1569 | + [`subtle.encrypt()`][] method using `wrappingKey` and `wrapAlgorithm` as inputs. If | ||
| 1570 | 1570 | successful, the returned promise will be resolved with an {ArrayBuffer} | |
| 1571 | 1571 | containing the encrypted key data. | |
| 1572 | 1572 | ||
@@ -2794,19 +2794,19 @@ added: v24.18.0 | |||
| 2794 | 2794 | [Web Crypto API]: https://www.w3.org/TR/WebCryptoAPI/ | |
| 2795 | 2795 | [`SubtleCrypto.supports()`]: #static-method-subtlecryptosupportsoperation-algorithm-lengthoradditionalalgorithm | |
| 2796 | 2796 | [`subtle.decapsulateBits()`]: #subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext | |
| 2797 | - [`subtle.decapsulateKey()`]: #subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-usages | ||
| 2797 | + [`subtle.decapsulateKey()`]: #subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-keyusages | ||
| 2798 | 2798 | [`subtle.decrypt()`]: #subtledecryptalgorithm-key-data | |
| 2799 | 2799 | [`subtle.deriveBits()`]: #subtlederivebitsalgorithm-basekey-length | |
| 2800 | - [`subtle.deriveKey()`]: #subtlederivekeyalgorithm-basekey-derivedkeyalgorithm-extractable-keyusages | ||
| 2800 | + [`subtle.deriveKey()`]: #subtlederivekeyalgorithm-basekey-derivedkeytype-extractable-keyusages | ||
| 2801 | 2801 | [`subtle.digest()`]: #subtledigestalgorithm-data | |
| 2802 | 2802 | [`subtle.encapsulateBits()`]: #subtleencapsulatebitsencapsulationalgorithm-encapsulationkey | |
| 2803 | - [`subtle.encapsulateKey()`]: #subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-usages | ||
| 2803 | + [`subtle.encapsulateKey()`]: #subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-keyusages | ||
| 2804 | 2804 | [`subtle.encrypt()`]: #subtleencryptalgorithm-key-data | |
| 2805 | 2805 | [`subtle.exportKey()`]: #subtleexportkeyformat-key | |
| 2806 | 2806 | [`subtle.generateKey()`]: #subtlegeneratekeyalgorithm-extractable-keyusages | |
| 2807 | 2807 | [`subtle.getPublicKey()`]: #subtlegetpublickeykey-keyusages | |
| 2808 | 2808 | [`subtle.importKey()`]: #subtleimportkeyformat-keydata-algorithm-extractable-keyusages | |
| 2809 | 2809 | [`subtle.sign()`]: #subtlesignalgorithm-key-data | |
| 2810 | - [`subtle.unwrapKey()`]: #subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgo-unwrappedkeyalgo-extractable-keyusages | ||
| 2810 | + [`subtle.unwrapKey()`]: #subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgorithm-unwrappedkeyalgorithm-extractable-keyusages | ||
| 2811 | 2811 | [`subtle.verify()`]: #subtleverifyalgorithm-key-signature-data | |
| 2812 | - [`subtle.wrapKey()`]: #subtlewrapkeyformat-key-wrappingkey-wrapalgo | ||
| 2812 | + [`subtle.wrapKey()`]: #subtlewrapkeyformat-key-wrappingkey-wrapalgorithm | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -175,14 +175,14 @@ function aesCipher(mode, key, data, algorithm) { | |||
| 175 | 175 | } | |
| 176 | 176 | } | |
| 177 | 177 | ||
| 178 | - function aesGenerateKey(algorithm, extractable, keyUsages) { | ||
| 178 | + function aesGenerateKey(algorithm, extractable, usages) { | ||
| 179 | 179 | const { name, length } = algorithm; | |
| 180 | 180 | ||
| 181 | 181 | const checkUsages = ['wrapKey', 'unwrapKey']; | |
| 182 | 182 | if (name !== 'AES-KW') | |
| 183 | 183 | ArrayPrototypePush(checkUsages, 'encrypt', 'decrypt'); | |
| 184 | 184 | ||
| 185 | - const usagesSet = new SafeSet(keyUsages); | ||
| 185 | + const usagesSet = new SafeSet(usages); | ||
| 186 | 186 | if (hasAnyNotIn(usagesSet, checkUsages)) { | |
| 187 | 187 | throw lazyDOMException( | |
| 188 | 188 | 'Unsupported key usage for an AES key', | |
@@ -207,13 +207,13 @@ function aesImportKey( | |||
| 207 | 207 | format, | |
| 208 | 208 | keyData, | |
| 209 | 209 | extractable, | |
| 210 | - keyUsages) { | ||
| 210 | + usages) { | ||
| 211 | 211 | const { name } = algorithm; | |
| 212 | 212 | const checkUsages = ['wrapKey', 'unwrapKey']; | |
| 213 | 213 | if (name !== 'AES-KW') | |
| 214 | 214 | ArrayPrototypePush(checkUsages, 'encrypt', 'decrypt'); | |
| 215 | 215 | ||
| 216 | - const usagesSet = new SafeSet(keyUsages); | ||
| 216 | + const usagesSet = new SafeSet(usages); | ||
| 217 | 217 | if (hasAnyNotIn(usagesSet, checkUsages)) { | |
| 218 | 218 | throw lazyDOMException( | |
| 219 | 219 | 'Unsupported key usage for an AES key', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -75,10 +75,10 @@ function verifyAcceptableCfrgKeyUse(name, isPublic, usages) { | |||
| 75 | 75 | } | |
| 76 | 76 | } | |
| 77 | 77 | ||
| 78 | - function cfrgGenerateKey(algorithm, extractable, keyUsages) { | ||
| 78 | + function cfrgGenerateKey(algorithm, extractable, usages) { | ||
| 79 | 79 | const { name } = algorithm; | |
| 80 | 80 | ||
| 81 | - const usageSet = new SafeSet(keyUsages); | ||
| 81 | + const usageSet = new SafeSet(usages); | ||
| 82 | 82 | switch (name) { | |
| 83 | 83 | case 'Ed25519': | |
| 84 | 84 | // Fall through | |
@@ -172,11 +172,11 @@ function cfrgImportKey( | |||
| 172 | 172 | keyData, | |
| 173 | 173 | algorithm, | |
| 174 | 174 | extractable, | |
| 175 | - keyUsages) { | ||
| 175 | + usages) { | ||
| 176 | 176 | ||
| 177 | 177 | const { name } = algorithm; | |
| 178 | 178 | let handle; | |
| 179 | - const usagesSet = new SafeSet(keyUsages); | ||
| 179 | + const usagesSet = new SafeSet(usages); | ||
| 180 | 180 | switch (format) { | |
| 181 | 181 | case 'KeyObject': { | |
| 182 | 182 | verifyAcceptableCfrgKeyUse( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,12 +47,12 @@ function c20pCipher(mode, key, data, algorithm) { | |||
| 47 | 47 | algorithm.additionalData)); | |
| 48 | 48 | } | |
| 49 | 49 | ||
| 50 | - function c20pGenerateKey(algorithm, extractable, keyUsages) { | ||
| 50 | + function c20pGenerateKey(algorithm, extractable, usages) { | ||
| 51 | 51 | const { name } = algorithm; | |
| 52 | 52 | ||
| 53 | 53 | const checkUsages = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']; | |
| 54 | 54 | ||
| 55 | - const usagesSet = new SafeSet(keyUsages); | ||
| 55 | + const usagesSet = new SafeSet(usages); | ||
| 56 | 56 | if (hasAnyNotIn(usagesSet, checkUsages)) { | |
| 57 | 57 | throw lazyDOMException( | |
| 58 | 58 | `Unsupported key usage for a ${algorithm.name} key`, | |
@@ -77,11 +77,11 @@ function c20pImportKey( | |||
| 77 | 77 | format, | |
| 78 | 78 | keyData, | |
| 79 | 79 | extractable, | |
| 80 | - keyUsages) { | ||
| 80 | + usages) { | ||
| 81 | 81 | const { name } = algorithm; | |
| 82 | 82 | const checkUsages = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']; | |
| 83 | 83 | ||
| 84 | - const usagesSet = new SafeSet(keyUsages); | ||
| 84 | + const usagesSet = new SafeSet(usages); | ||
| 85 | 85 | if (hasAnyNotIn(usagesSet, checkUsages)) { | |
| 86 | 86 | throw lazyDOMException( | |
| 87 | 87 | `Unsupported key usage for a ${algorithm.name} key`, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,10 +77,10 @@ function verifyAcceptableEcKeyUse(name, isPublic, usages) { | |||
| 77 | 77 | } | |
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | - function ecGenerateKey(algorithm, extractable, keyUsages) { | ||
| 80 | + function ecGenerateKey(algorithm, extractable, usages) { | ||
| 81 | 81 | const { name, namedCurve } = algorithm; | |
| 82 | 82 | ||
| 83 | - const usageSet = new SafeSet(keyUsages); | ||
| 83 | + const usageSet = new SafeSet(usages); | ||
| 84 | 84 | switch (name) { | |
| 85 | 85 | case 'ECDSA': | |
| 86 | 86 | if (hasAnyNotIn(usageSet, ['sign', 'verify'])) { | |
@@ -178,12 +178,12 @@ function ecImportKey( | |||
| 178 | 178 | keyData, | |
| 179 | 179 | algorithm, | |
| 180 | 180 | extractable, | |
| 181 | - keyUsages, | ||
| 181 | + usages, | ||
| 182 | 182 | ) { | |
| 183 | 183 | const { name, namedCurve } = algorithm; | |
| 184 | 184 | ||
| 185 | 185 | let handle; | |
| 186 | - const usagesSet = new SafeSet(keyUsages); | ||
| 186 | + const usagesSet = new SafeSet(usages); | ||
| 187 | 187 | switch (format) { | |
| 188 | 188 | case 'KeyObject': { | |
| 189 | 189 | verifyAcceptableEcKeyUse( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,14 +40,14 @@ const { | |||
| 40 | 40 | validateJwk, | |
| 41 | 41 | } = require('internal/crypto/webcrypto_util'); | |
| 42 | 42 | ||
| 43 | - function hmacGenerateKey(algorithm, extractable, keyUsages) { | ||
| 43 | + function hmacGenerateKey(algorithm, extractable, usages) { | ||
| 44 | 44 | const { | |
| 45 | 45 | hash, | |
| 46 | 46 | name, | |
| 47 | 47 | length = getBlockSize(hash.name), | |
| 48 | 48 | } = algorithm; | |
| 49 | 49 | ||
| 50 | - const usageSet = new SafeSet(keyUsages); | ||
| 50 | + const usageSet = new SafeSet(usages); | ||
| 51 | 51 | if (hasAnyNotIn(usageSet, ['sign', 'verify'])) { | |
| 52 | 52 | throw lazyDOMException( | |
| 53 | 53 | 'Unsupported key usage for an HMAC key', | |
@@ -67,7 +67,7 @@ function hmacGenerateKey(algorithm, extractable, keyUsages) { | |||
| 67 | 67 | extractable)); | |
| 68 | 68 | } | |
| 69 | 69 | ||
| 70 | - function kmacGenerateKey(algorithm, extractable, keyUsages) { | ||
| 70 | + function kmacGenerateKey(algorithm, extractable, usages) { | ||
| 71 | 71 | const { | |
| 72 | 72 | name, | |
| 73 | 73 | length = { | |
@@ -77,7 +77,7 @@ function kmacGenerateKey(algorithm, extractable, keyUsages) { | |||
| 77 | 77 | }[name], | |
| 78 | 78 | } = algorithm; | |
| 79 | 79 | ||
| 80 | - const usageSet = new SafeSet(keyUsages); | ||
| 80 | + const usageSet = new SafeSet(usages); | ||
| 81 | 81 | if (hasAnyNotIn(usageSet, ['sign', 'verify'])) { | |
| 82 | 82 | throw lazyDOMException( | |
| 83 | 83 | `Unsupported key usage for ${name} key`, | |
@@ -102,10 +102,10 @@ function macImportKey( | |||
| 102 | 102 | keyData, | |
| 103 | 103 | algorithm, | |
| 104 | 104 | extractable, | |
| 105 | - keyUsages, | ||
| 105 | + usages, | ||
| 106 | 106 | ) { | |
| 107 | 107 | const isHmac = algorithm.name === 'HMAC'; | |
| 108 | - const usagesSet = new SafeSet(keyUsages); | ||
| 108 | + const usagesSet = new SafeSet(usages); | ||
| 109 | 109 | if (hasAnyNotIn(usagesSet, ['sign', 'verify'])) { | |
| 110 | 110 | throw lazyDOMException( | |
| 111 | 111 | `Unsupported key usage for ${algorithm.name} key`, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,10 +63,10 @@ function verifyAcceptableMlDsaKeyUse(name, isPublic, usages) { | |||
| 63 | 63 | } | |
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | - function mlDsaGenerateKey(algorithm, extractable, keyUsages) { | ||
| 66 | + function mlDsaGenerateKey(algorithm, extractable, usages) { | ||
| 67 | 67 | const { name } = algorithm; | |
| 68 | 68 | ||
| 69 | - const usageSet = new SafeSet(keyUsages); | ||
| 69 | + const usageSet = new SafeSet(usages); | ||
| 70 | 70 | if (hasAnyNotIn(usageSet, ['sign', 'verify'])) { | |
| 71 | 71 | throw lazyDOMException( | |
| 72 | 72 | `Unsupported key usage for an ${name} key`, | |
@@ -144,11 +144,11 @@ function mlDsaImportKey( | |||
| 144 | 144 | keyData, | |
| 145 | 145 | algorithm, | |
| 146 | 146 | extractable, | |
| 147 | - keyUsages) { | ||
| 147 | + usages) { | ||
| 148 | 148 | ||
| 149 | 149 | const { name } = algorithm; | |
| 150 | 150 | let handle; | |
| 151 | - const usagesSet = new SafeSet(keyUsages); | ||
| 151 | + const usagesSet = new SafeSet(usages); | ||
| 152 | 152 | switch (format) { | |
| 153 | 153 | case 'KeyObject': { | |
| 154 | 154 | verifyAcceptableMlDsaKeyUse( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,10 +51,10 @@ const { | |||
| 51 | 51 | validateJwk, | |
| 52 | 52 | } = require('internal/crypto/webcrypto_util'); | |
| 53 | 53 | ||
| 54 | - function mlKemGenerateKey(algorithm, extractable, keyUsages) { | ||
| 54 | + function mlKemGenerateKey(algorithm, extractable, usages) { | ||
| 55 | 55 | const { name } = algorithm; | |
| 56 | 56 | ||
| 57 | - const usageSet = new SafeSet(keyUsages); | ||
| 57 | + const usageSet = new SafeSet(usages); | ||
| 58 | 58 | if (hasAnyNotIn(usageSet, ['encapsulateKey', 'encapsulateBits', 'decapsulateKey', 'decapsulateBits'])) { | |
| 59 | 59 | throw lazyDOMException( | |
| 60 | 60 | `Unsupported key usage for an ${name} key`, | |
@@ -143,11 +143,11 @@ function mlKemImportKey( | |||
| 143 | 143 | keyData, | |
| 144 | 144 | algorithm, | |
| 145 | 145 | extractable, | |
| 146 | - keyUsages) { | ||
| 146 | + usages) { | ||
| 147 | 147 | ||
| 148 | 148 | const { name } = algorithm; | |
| 149 | 149 | let handle; | |
| 150 | - const usagesSet = new SafeSet(keyUsages); | ||
| 150 | + const usagesSet = new SafeSet(usages); | ||
| 151 | 151 | switch (format) { | |
| 152 | 152 | case 'KeyObject': { | |
| 153 | 153 | verifyAcceptableMlKemKeyUse( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments