Skip to main content

EncryptionKey

The EncryptionKey class is designed for encrypting and decrypting data between the mobile client and a Cloud node. The encryption algorithm used in this class is ChaChaBox.

Accessors

publicKeyB64

Get Signature

get publicKeyB64(): string

Returns

string


publicKeyHex

Get Signature

get publicKeyHex(): string

Returns

string

Methods

decryptData()

decryptData(data, senderEncKey): string

Decrypts the data using the sender's encryption public key.

Parameters

data

string

base64 encoded encrypted data.

senderEncKey

string

base64 encoded sender encryption public key.

Returns

string

base64 encoded decrypted data.


encryptData()

encryptData(data, receiverEncKey): string

Encrypts the data using the receiver's encryption public key.

Parameters

data

string

base64 encoded data to encrypt.

receiverEncKey

string

base64 encoded receiver encryption public key.

Returns

string

base64 encoded encrypted data.


free()

free(): Promise<boolean>

Returns

Promise<boolean>


create()

static create(): EncryptionKey

Creates a new encryption key for the mobile client.

Returns

EncryptionKey