MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / serializeSessionKey

Function serializeSessionKey

cli/src/cache/driveCryptoCacheAdapter.ts:183–192  ·  view source on GitHub ↗
(sk: SessionKey)

Source from the content-addressed store, hash-verified

181}
182
183function serializeSessionKey(sk: SessionKey): SerializedSessionKey {
184 const output: SerializedSessionKey = {
185 dataBase64: Buffer.from(sk.data).toString('base64'),
186 algorithm: sk.algorithm as unknown as number,
187 };
188 if (sk.aeadAlgorithm !== undefined) {
189 output.aeadAlgorithm = sk.aeadAlgorithm as unknown as number;
190 }
191 return output;
192}
193
194function deserializeSessionKey(json: SerializedSessionKey): SessionKey {
195 const output: SessionKey = {

Callers 1

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected