(ivCipher: IvCipher, key: CryptoKey)
| 103 | } |
| 104 | |
| 105 | async function decrypt(ivCipher: IvCipher, key: CryptoKey) { |
| 106 | const [iv, cipher] = splitIvCipher(base64ToArray(ivCipher).buffer) |
| 107 | const decrypted = await crypto.subtle.decrypt( |
| 108 | { |
| 109 | name: 'AES-GCM', |
| 110 | iv, |
| 111 | }, |
| 112 | key, |
| 113 | cipher, |
| 114 | ) |
| 115 | return decoder.decode(decrypted) |
| 116 | } |
| 117 | |
| 118 | export class SignedCookieManager { |
| 119 | constructor(name: string, cookieOptions: MaxAgeOverExpires) { |
no test coverage detected