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

Function importVectorKey

test/parallel/test-webcrypto-encrypt-decrypt-rsa.js:15–30  ·  view source on GitHub ↗
(
  publicKeyBuffer,
  privateKeyBuffer,
  name,
  hash,
  publicUsages,
  privateUsages)

Source from the content-addressed store, hash-verified

13} = require('../fixtures/crypto/rsa')();
14
15async function importVectorKey(
16 publicKeyBuffer,
17 privateKeyBuffer,
18 name,
19 hash,
20 publicUsages,
21 privateUsages) {
22 const [publicKey, privateKey] = await Promise.all([
23 subtle.importKey(
24 'spki', publicKeyBuffer, { name, hash }, false, publicUsages),
25 subtle.importKey(
26 'pkcs8', privateKeyBuffer, { name, hash }, false, privateUsages),
27 ]);
28
29 return { publicKey, privateKey };
30}
31
32async function testDecryption({ ciphertext,
33 algorithm,

Callers 7

testDecryptionFunction · 0.70
testEncryptionFunction · 0.70
testEncryptionWrongKeyFunction · 0.70
testEncryptionBadUsageFunction · 0.70
testDecryptionWrongKeyFunction · 0.70
testDecryptionBadUsageFunction · 0.70

Calls 1

allMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…