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

Function prepareKey

lib/internal/crypto/hkdf.js:80–104  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

78});
79
80function prepareKey(key) {
81 if (isKeyObject(key))
82 return prepareSecretKey(key);
83
84 if (isAnyArrayBuffer(key))
85 return key;
86
87 key = toBuf(key);
88
89 if (!isArrayBufferView(key)) {
90 throw new ERR_INVALID_ARG_TYPE(
91 'ikm',
92 [
93 'string',
94 'SecretKeyObject',
95 'ArrayBuffer',
96 'TypedArray',
97 'DataView',
98 'Buffer',
99 ],
100 key);
101 }
102
103 return key;
104}
105
106function hkdf(hash, key, salt, info, length, callback) {
107 ({

Callers 1

hkdf.jsFile · 0.85

Calls 3

isKeyObjectFunction · 0.85
prepareSecretKeyFunction · 0.85
toBufFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…