orbis.decryptMessage()

Decrypts an encrypted message.

How to use?

let res = await orbis.decryptMessage(content);

Parameters

  • content: JSON object that contains the full content of the message
  • conversation_id: string ID of the conversation the message is from
  • encryptedMessage: object JSON object containing the encryption details
  • encryptedString: string Encrypted string generated by Lit Protocol
  • encryptedSymmetricKey: string Encrypted symmetric key generated by Lit Protocol
  • accessControlConditions: string Array of access control conditions stored as a string

Examples

/** Retrieve messages from a conversation */
let { data: messages } = await orbis.getMessages("k...");

/**
 * In another function loop through all messages and pass
 * each message' content as a parameter of the decrypt function
 */
let res = await orbis.decryptMessage(message.content);

Returns

{
  result: "Content of the message decrypted"
}