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

Function getKeyTypes

lib/internal/crypto/keys.js:533–549  ·  view source on GitHub ↗
(allowKeyObject, bufferOnly = false)

Source from the content-addressed store, hash-verified

531}
532
533function getKeyTypes(allowKeyObject, bufferOnly = false) {
534 const types = [
535 'ArrayBuffer',
536 'Buffer',
537 'TypedArray',
538 'DataView',
539 'string', // Only if bufferOnly == false
540 'KeyObject', // Only if allowKeyObject == true && bufferOnly == false
541 'CryptoKey', // Only if allowKeyObject == true && bufferOnly == false
542 ];
543 if (bufferOnly) {
544 return ArrayPrototypeSlice(types, 0, 4);
545 } else if (!allowKeyObject) {
546 return ArrayPrototypeSlice(types, 0, 5);
547 }
548 return types;
549}
550
551
552function prepareAsymmetricKey(key, ctx, name = 'key') {

Callers 2

prepareAsymmetricKeyFunction · 0.85
prepareSecretKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…