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

Function rsaExportKey

lib/internal/crypto/rsa.js:149–168  ·  view source on GitHub ↗
(key, format)

Source from the content-addressed store, hash-verified

147}
148
149function rsaExportKey(key, format) {
150 try {
151 switch (format) {
152 case kWebCryptoKeyFormatSPKI: {
153 return TypedArrayPrototypeGetBuffer(
154 getCryptoKeyHandle(key).export(kKeyFormatDER, kWebCryptoKeyFormatSPKI));
155 }
156 case kWebCryptoKeyFormatPKCS8: {
157 return TypedArrayPrototypeGetBuffer(
158 getCryptoKeyHandle(key).export(kKeyFormatDER, kWebCryptoKeyFormatPKCS8, null, null));
159 }
160 default:
161 return undefined;
162 }
163 } catch (err) {
164 throw lazyDOMException(
165 'The operation failed for an operation-specific reason',
166 { name: 'OperationError', cause: err });
167 }
168}
169
170function rsaImportKey(
171 format,

Callers

nothing calls this directly

Calls 3

getCryptoKeyHandleFunction · 0.85
lazyDOMExceptionFunction · 0.85
exportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…