({ algorithm,
plaintext,
hash,
publicKeyBuffer,
privateKeyBuffer })
| 152 | } |
| 153 | |
| 154 | async function testEncryptionBadUsage({ algorithm, |
| 155 | plaintext, |
| 156 | hash, |
| 157 | publicKeyBuffer, |
| 158 | privateKeyBuffer }) { |
| 159 | const { |
| 160 | publicKey, |
| 161 | } = await importVectorKey( |
| 162 | publicKeyBuffer, |
| 163 | privateKeyBuffer, |
| 164 | algorithm.name, |
| 165 | hash, |
| 166 | ['wrapKey'], |
| 167 | ['decrypt']); |
| 168 | return assert.rejects( |
| 169 | subtle.encrypt(algorithm, publicKey, plaintext), { |
| 170 | message: /Unable to use this key to encrypt/ |
| 171 | }); |
| 172 | } |
| 173 | |
| 174 | async function testDecryptionWrongKey({ ciphertext, |
| 175 | algorithm, |
no test coverage detected
searching dependent graphs…