MCPcopy Create free account
hub / github.com/AlexErrant/Pentive / decrypt

Function decrypt

hub/src/cookieManager.ts:105–116  ·  view source on GitHub ↗
(ivCipher: IvCipher, key: CryptoKey)

Source from the content-addressed store, hash-verified

103}
104
105async 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
118export class SignedCookieManager {
119 constructor(name: string, cookieOptions: MaxAgeOverExpires) {

Callers 1

parseMethod · 0.85

Calls 2

base64ToArrayFunction · 0.90
splitIvCipherFunction · 0.85

Tested by

no test coverage detected