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

Function toPublicCryptoKey

lib/internal/crypto/keys.js:834–843  ·  view source on GitHub ↗

* Derives a public CryptoKey from a private CryptoKey. The resulting key uses * the private key's algorithm, is extractable, and validates the requested * public usages through the shared asymmetric import path. * @param {CryptoKey} key * @param {string[]} keyUsages * @returns {CryptoKey}

(key, keyUsages)

Source from the content-addressed store, hash-verified

832 * @returns {CryptoKey}
833 */
834function toPublicCryptoKey(key, keyUsages) {
835 const handle = new KeyObjectHandle();
836 handle.init(kKeyTypePublic, getCryptoKeyHandle(key),
837 null, null, null, null);
838 return toCryptoKey(
839 handle,
840 getCryptoKeyAlgorithm(key),
841 true,
842 keyUsages);
843}
844
845function createPrivateKey(key) {
846 const { format, type, data, passphrase, namedCurve } =

Callers 1

getPublicKeyImplFunction · 0.85

Calls 4

getCryptoKeyHandleFunction · 0.85
toCryptoKeyFunction · 0.85
getCryptoKeyAlgorithmFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…