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

Function createPublicKey

lib/internal/crypto/keys.js:675–682  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

673}
674
675function createPublicKey(key) {
676 const { format, type, data, passphrase, namedCurve } =
677 prepareAsymmetricKey(key, kCreatePublic);
678 const handle = new KeyObjectHandle();
679 handle.init(kKeyTypePublic, data, format ?? null,
680 type ?? null, passphrase ?? null, namedCurve ?? null);
681 return new PublicKeyObject(handle);
682}
683
684/**
685 * Converts a secret KeyObjectHandle to a CryptoKey by dispatching to the

Calls 2

prepareAsymmetricKeyFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…