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

Function getPublicKeyImpl

lib/internal/crypto/webcrypto.js:1333–1347  ·  view source on GitHub ↗
(key, keyUsages)

Source from the content-addressed store, hash-verified

1331}
1332
1333function getPublicKeyImpl(key, keyUsages) {
1334 emitExperimentalWarning('The getPublicKey Web Crypto API method');
1335 const prefix = prepareSubtleMethod(this, 'getPublicKey', arguments.length, 2);
1336 let i = 0;
1337 key = convertSubtleArgument(prefix, 'CryptoKey', key, i++);
1338 const usages = convertSubtleArgument(
1339 prefix, 'sequence<KeyUsage>', keyUsages, i++);
1340
1341 const type = getCryptoKeyType(key);
1342 if (type !== 'private')
1343 throw lazyDOMException('key must be a private key',
1344 type === 'secret' ? 'NotSupportedError' : 'InvalidAccessError');
1345
1346 return toPublicCryptoKey(key, usages);
1347}
1348
1349function encapsulateBits(encapsulationAlgorithm, encapsulationKey) {
1350 return callSubtleCryptoMethod(encapsulateBitsImpl, this, arguments);

Callers

nothing calls this directly

Calls 6

emitExperimentalWarningFunction · 0.85
prepareSubtleMethodFunction · 0.85
convertSubtleArgumentFunction · 0.85
getCryptoKeyTypeFunction · 0.85
lazyDOMExceptionFunction · 0.85
toPublicCryptoKeyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…