(alg: string, key: types.CryptoKey, cek: Uint8Array)
| 18 | } |
| 19 | |
| 20 | export async function encrypt(alg: string, key: types.CryptoKey, cek: Uint8Array) { |
| 21 | checkEncCryptoKey(key, alg, 'encrypt') |
| 22 | checkKeyLength(alg, key) |
| 23 | |
| 24 | return new Uint8Array( |
| 25 | await crypto.subtle.encrypt(subtleAlgorithm(alg), key, cek as Uint8Array<ArrayBuffer>), |
| 26 | ) |
| 27 | } |
| 28 | |
| 29 | export async function decrypt(alg: string, key: types.CryptoKey, encryptedKey: Uint8Array) { |
| 30 | checkEncCryptoKey(key, alg, 'decrypt') |
no test coverage detected
searching dependent graphs…