sinch-rtc
Version:
RTC JavaScript/Web SDK
36 lines (35 loc) • 1.13 kB
TypeScript
import { Client, Body, SymmetricKey } from "./models";
/**
* Encrypt and decrypts MXP messages and clients
*/
export declare class Codec {
/**
* Method that encodes MXP message using random IV. Should produce different output for every invocation.
* @param payload - payload string
* @param key - user encryption key
*/
static encrypt(payload: string, key: SymmetricKey): string;
/**
* Private method that encodes MXP message with possiblity of injecting IV
* @param payload - payload string
* @param key - user encryption key
* @param iv - initialization vector
*/
private static encodeWithIV;
/**
* Method that decodes MXP message
* @param encryptedPayload - raw data in base64 format
* @param key - user encryption key
*/
static decrypt(encryptedPayload: string, key: SymmetricKey): string;
/**
* Serializes the data in client
* @param client -
*/
static encodeClient(client: Client): Body;
/**
* Parses stringified client data
* @param body -
*/
static decodeClient(body: Body): Client;
}