(algorithm, key, data)
| 1301 | } |
| 1302 | |
| 1303 | function decryptImpl(algorithm, key, data) { |
| 1304 | const prefix = prepareSubtleMethod(this, 'decrypt', arguments.length, 3); |
| 1305 | let i = 0; |
| 1306 | algorithm = convertSubtleArgument( |
| 1307 | prefix, 'AlgorithmIdentifier', algorithm, i++); |
| 1308 | key = convertSubtleArgument(prefix, 'CryptoKey', key, i++); |
| 1309 | data = convertSubtleArgument(prefix, 'BufferSource', data, i++); |
| 1310 | |
| 1311 | const normalizedAlgorithm = normalizeAlgorithm(algorithm, 'decrypt'); |
| 1312 | |
| 1313 | if (normalizedAlgorithm.name !== getCryptoKeyAlgorithm(key).name) |
| 1314 | throw lazyDOMException('Key algorithm mismatch', 'InvalidAccessError'); |
| 1315 | |
| 1316 | if (!hasCryptoKeyUsage(key, 'decrypt')) |
| 1317 | throw lazyDOMException( |
| 1318 | 'Unable to use this key to decrypt', 'InvalidAccessError'); |
| 1319 | |
| 1320 | return cipherOrWrap( |
| 1321 | kWebCryptoCipherDecrypt, |
| 1322 | normalizedAlgorithm, |
| 1323 | key, |
| 1324 | data, |
| 1325 | ); |
| 1326 | } |
| 1327 | |
| 1328 | // Implements https://wicg.github.io/webcrypto-modern-algos/#SubtleCrypto-method-getPublicKey |
| 1329 | function getPublicKey(key, keyUsages) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…