({ ciphertext,
algorithm,
hash,
publicKeyBuffer,
privateKeyBuffer })
| 196 | } |
| 197 | |
| 198 | async 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 = []; |
no test coverage detected
searching dependent graphs…