(json: SerializedSessionKey)
| 192 | } |
| 193 | |
| 194 | function deserializeSessionKey(json: SerializedSessionKey): SessionKey { |
| 195 | const output: SessionKey = { |
| 196 | data: new Uint8Array(Buffer.from(json.dataBase64, 'base64')), |
| 197 | algorithm: json.algorithm as unknown as SessionKey['algorithm'], |
| 198 | }; |
| 199 | if (json.aeadAlgorithm !== undefined) { |
| 200 | output.aeadAlgorithm = json.aeadAlgorithm as unknown as NonNullable<SessionKey['aeadAlgorithm']>; |
| 201 | } |
| 202 | return output; |
| 203 | } |
no outgoing calls
no test coverage detected