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

Function importRawKey

lib/internal/crypto/webcrypto_util.js:220–230  ·  view source on GitHub ↗
(isPublic, keyData, format, name, namedCurve)

Source from the content-addressed store, hash-verified

218}
219
220function importRawKey(isPublic, keyData, format, name, namedCurve) {
221 const handle = new KeyObjectHandle();
222 const keyType = isPublic ? kKeyTypePublic : kKeyTypePrivate;
223 try {
224 handle.init(keyType, keyData, format, name ?? null, null, namedCurve ?? null);
225 } catch (err) {
226 throw lazyDOMException(
227 'Invalid keyData', { name: 'DataError', cause: err });
228 }
229 return handle;
230}
231
232function importSecretKey(keyData) {
233 const handle = new KeyObjectHandle();

Callers 4

mlDsaImportKeyFunction · 0.85
mlKemImportKeyFunction · 0.85
ecImportKeyFunction · 0.85
cfrgImportKeyFunction · 0.85

Calls 2

lazyDOMExceptionFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…