(sk: SessionKey)
| 181 | } |
| 182 | |
| 183 | function 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 | |
| 194 | function deserializeSessionKey(json: SerializedSessionKey): SessionKey { |
| 195 | const output: SessionKey = { |
no test coverage detected