({ ciphertext,
algorithm,
hash,
publicKeyBuffer,
privateKeyBuffer })
| 172 | } |
| 173 | |
| 174 | async function testDecryptionWrongKey({ ciphertext, |
| 175 | algorithm, |
| 176 | hash, |
| 177 | publicKeyBuffer, |
| 178 | privateKeyBuffer }) { |
| 179 | if (ciphertext === undefined) |
| 180 | return; |
| 181 | |
| 182 | const { |
| 183 | publicKey |
| 184 | } = await importVectorKey( |
| 185 | publicKeyBuffer, |
| 186 | privateKeyBuffer, |
| 187 | algorithm.name, |
| 188 | hash, |
| 189 | ['encrypt'], |
| 190 | ['decrypt']); |
| 191 | |
| 192 | return assert.rejects( |
| 193 | subtle.decrypt(algorithm, publicKey, ciphertext), { |
| 194 | message: /Unable to use this key to decrypt/ |
| 195 | }); |
| 196 | } |
| 197 | |
| 198 | async function testDecryptionBadUsage({ ciphertext, |
| 199 | algorithm, |
no test coverage detected
searching dependent graphs…