MCPcopy Index your code
hub / github.com/nodejs/node / validateKeyUsages

Function validateKeyUsages

lib/internal/crypto/webcrypto_util.js:62–66  ·  view source on GitHub ↗

* Converts a usage list to a set and validates it against `allowed`. * @param {string[]} usages * @param {string[]} allowed * @param {string} subject * @returns {SafeSet }

(usages, allowed, subject)

Source from the content-addressed store, hash-verified

60 * @returns {SafeSet<string>}
61 */
62function validateKeyUsages(usages, allowed, subject) {
63 const usagesSet = new SafeSet(usages);
64 verifyAcceptableKeyUse(subject, usagesSet, allowed);
65 return usagesSet;
66}
67
68/**
69 * Validates that a usage set is not empty.

Callers 12

mlDsaGenerateKeyFunction · 0.85
mlKemGenerateKeyFunction · 0.85
c20pGenerateKeyFunction · 0.85
c20pImportKeyFunction · 0.85
ecGenerateKeyFunction · 0.85
cfrgGenerateKeyFunction · 0.85
hmacGenerateKeyFunction · 0.85
kmacGenerateKeyFunction · 0.85
macImportKeyFunction · 0.85
aesGenerateKeyFunction · 0.85
aesImportKeyFunction · 0.85
rsaKeyGenerateFunction · 0.85

Calls 1

verifyAcceptableKeyUseFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…