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

Function testDecryptionBadUsage

test/parallel/test-webcrypto-encrypt-decrypt-rsa.js:198–220  ·  view source on GitHub ↗
({ ciphertext,
                                        algorithm,
                                        hash,
                                        publicKeyBuffer,
                                        privateKeyBuffer })

Source from the content-addressed store, hash-verified

196}
197
198async function testDecryptionBadUsage({ ciphertext,
199 algorithm,
200 hash,
201 publicKeyBuffer,
202 privateKeyBuffer }) {
203 if (ciphertext === undefined)
204 return;
205
206 const {
207 publicKey
208 } = await importVectorKey(
209 publicKeyBuffer,
210 privateKeyBuffer,
211 algorithm.name,
212 hash,
213 ['encrypt'],
214 ['unwrapKey']);
215
216 return assert.rejects(
217 subtle.decrypt(algorithm, publicKey, ciphertext), {
218 message: /Unable to use this key to decrypt/
219 });
220}
221
222(async function() {
223 const variations = [];

Calls 1

importVectorKeyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…