({ algorithm,
plaintext,
hash,
publicKeyBuffer,
privateKeyBuffer })
| 132 | } |
| 133 | |
| 134 | async function testEncryptionWrongKey({ algorithm, |
| 135 | plaintext, |
| 136 | hash, |
| 137 | publicKeyBuffer, |
| 138 | privateKeyBuffer }) { |
| 139 | const { |
| 140 | privateKey, |
| 141 | } = await importVectorKey( |
| 142 | publicKeyBuffer, |
| 143 | privateKeyBuffer, |
| 144 | algorithm.name, |
| 145 | hash, |
| 146 | ['encrypt'], |
| 147 | ['decrypt']); |
| 148 | return assert.rejects( |
| 149 | subtle.encrypt(algorithm, privateKey, plaintext), { |
| 150 | message: /Unable to use this key to encrypt/ |
| 151 | }); |
| 152 | } |
| 153 | |
| 154 | async function testEncryptionBadUsage({ algorithm, |
| 155 | plaintext, |
no test coverage detected
searching dependent graphs…