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

Function importDerKey

lib/internal/crypto/webcrypto_util.js:132–143  ·  view source on GitHub ↗
(keyData, isPublic)

Source from the content-addressed store, hash-verified

130}
131
132function importDerKey(keyData, isPublic) {
133 const handle = new KeyObjectHandle();
134 const keyType = isPublic ? kKeyTypePublic : kKeyTypePrivate;
135 const encoding = isPublic ? kKeyEncodingSPKI : kKeyEncodingPKCS8;
136 try {
137 handle.init(keyType, keyData, kKeyFormatDER, encoding, null, null);
138 } catch (err) {
139 throw lazyDOMException(
140 'Invalid keyData', { name: 'DataError', cause: err });
141 }
142 return handle;
143}
144
145function validateJwk(keyData, kty, extractable, usagesSet, expectedUse) {
146 if (typeof keyData.kty !== 'string')

Callers 5

mlDsaImportKeyFunction · 0.85
mlKemImportKeyFunction · 0.85
ecImportKeyFunction · 0.85
cfrgImportKeyFunction · 0.85
rsaImportKeyFunction · 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…