Chat SDK for Android v1.3.2
agora java chat SDK
 
Loading...
Searching...
No Matches
io.agora.chat.EMEncryptProvider Interface Reference

Public Member Functions

byte[] encrypt (byte[] input, String toUserName)
 
byte[] decrypt (byte[] input, String fromUserName)
 

Detailed Description

The encryption and decryption class.

You can use built-in encryption and decryption alogrithms based on AES or build your own algorithms by usin EncryptProvider to encrypt or decrypt messages and attachments.

For example, encryption:

EaseMobChat.getInstance().setEncryptionMode(true);
EaseMobChat.getInstance().setEncryptProvider(new MyEncryptProvider());

When sending a message, if EncryptProvider is configured, the SDK will call the encryption method to encrypt the message before delivery. While receiving a message, if this message is encrypted, the SDK will call the EncryptProvider to decrypt it.

Member Function Documentation

◆ decrypt()

byte[] io.agora.chat.EMEncryptProvider.decrypt ( byte[] input,
String fromUserName )

The decryption method.

Parameters
inputThe encrypted byte array.
fromUserNameThe username of the message sender.
Returns
Returns the decrypted byte array.

◆ encrypt()

byte[] io.agora.chat.EMEncryptProvider.encrypt ( byte[] input,
String toUserName )

The encryption method.

Parameters
inputThe byte array to be encrypted.
toUserNameThe user ID of the other side of the conversation.
Returns
Returns the encrypted byte array.

The documentation for this interface was generated from the following file: