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

Function hmacGenerateKey

lib/internal/crypto/mac.js:66–82  ·  view source on GitHub ↗
(algorithm, extractable, usages)

Source from the content-addressed store, hash-verified

64}
65
66function hmacGenerateKey(algorithm, extractable, usages) {
67 const {
68 hash,
69 name,
70 length = getBlockSize(hash.name),
71 } = algorithm;
72
73 const usageSet = validateUsagesNotEmpty(
74 validateKeyUsages(usages, kUsages, name));
75
76 return jobPromise(() => new SecretKeyGenJob(
77 kCryptoJobWebCrypto,
78 length,
79 { name, length, hash },
80 getUsagesMask(usageSet),
81 extractable));
82}
83
84function kmacGenerateKey(algorithm, extractable, usages) {
85 const {

Callers

nothing calls this directly

Calls 5

getBlockSizeFunction · 0.85
validateUsagesNotEmptyFunction · 0.85
validateKeyUsagesFunction · 0.85
jobPromiseFunction · 0.85
getUsagesMaskFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…