# Interface: EncryptionSession

# Table of contents

# Properties

# Methods

# Properties

# sessionId

sessionId: string

The sessionId for this EncryptionSession instance.

# Methods

# addRecipients

addRecipients(recipients): Promise<AuthorizeRecipientResult>

Add new recipients to this session. These recipients will be able to read all encrypted message of this session.

# Parameters

Name Type
recipients Recipients

# Returns

Promise<AuthorizeRecipientResult>


# decryptFile

decryptFile<T>(encryptedFile): Promise<T>

Decrypts an encrypted file

# Type parameters

Name Type
T extends string | Buffer | Blob | ReadableStream<any> | Readable

# Parameters

Name Type
encryptedFile T

# Returns

Promise<T>


# decryptMessage

decryptMessage(encryptedText): Promise<string>

Decrypts an encrypted message string into the corresponding clear-text string.

# Parameters

Name Type
encryptedText string

# Returns

Promise<string>


# encryptFile

encryptFile<T>(clearFile, filename, opts?): Promise<T>

Encrypts a file

# Type parameters

Name Type
T extends string | Buffer | Blob | ReadableStream<any> | Readable

# Parameters

Name Type Description
clearFile T
filename string
opts? Object
opts.fileSize? number Optional. Needed when using stream

# Returns

Promise<T>


# encryptMessage

encryptMessage(clearText): Promise<string>

Encrypts a clear-text string into an encrypted message, for the recipients of this session.

# Parameters

Name Type
clearText string

# Returns

Promise<string>


# revoke

revoke(): Promise<RevokeResult>

Entirely revoke this session. You can only do it if you are this session's administrator.

# Returns

Promise<RevokeResult>


# revokeRecipients

revokeRecipients(recipients): Promise<RevokeResult>

Revoke recipients from this session. You can only do it if you added these recipients yourself, or if you are this session's administrator.

# Parameters

Name Type
recipients Recipients

# Returns

Promise<RevokeResult>