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

Function verifyAcceptableKeyUse

lib/internal/crypto/webcrypto_util.js:47–53  ·  view source on GitHub ↗

* Validates that every requested key usage is allowed for `subject`. * @param {string} subject * @param {SafeSet } usagesSet * @param {string[]} allowed

(subject, usagesSet, allowed)

Source from the content-addressed store, hash-verified

45 * @param {string[]} allowed
46 */
47function verifyAcceptableKeyUse(subject, usagesSet, allowed) {
48 if (hasAnyNotIn(usagesSet, allowed)) {
49 throw lazyDOMException(
50 `Unsupported key usage for ${subject} key`,
51 'SyntaxError');
52 }
53}
54
55/**
56 * Converts a usage list to a set and validates it against `allowed`.

Callers 6

mlDsaImportKeyFunction · 0.85
mlKemImportKeyFunction · 0.85
validateKeyUsagesFunction · 0.85
ecImportKeyFunction · 0.85
cfrgImportKeyFunction · 0.85
rsaImportKeyFunction · 0.85

Calls 2

hasAnyNotInFunction · 0.85
lazyDOMExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…