Skip to content

Interface: AnonymousEncryptionSession

Contents

Properties

sessionId

sessionId: string

The sessionId for this EncryptionSession instance.

Methods

decryptFile()

decryptFile<T>(encryptedFile, opts?): Promise<Object>

Decrypts an encrypted file

Type parameters

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

Parameters

encryptedFile: T

opts?: Object

opts.fileSize?: number

Optional. Size of the file to decrypt. Needed when using progressCallback with a ReadableStream or NodeReadable as input type.

opts.progressCallback?: (progress) => void

opts.signal?: AbortSignal

Optional. An AbortSignal to cancel the decryption.

Returns

Promise<Object>

data

data: T

filename

filename: string

sessionId

sessionId: string

size

size: number

type

type: FileType


decryptMessage()

decryptMessage(encryptedMessage, options?): Promise<string>

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

Parameters

encryptedMessage: string

options?: Object

options.raw?: boolean

Optional. Whether or not the message was encrypted raw. Defaults to false.

Returns

Promise<string>


encryptFile()

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

Encrypts a file

Type parameters

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

Parameters

clearFile: T

filename: string

opts?: Object

opts.fileSize?: number

Optional. Needed when using stream

opts.signal?: AbortSignal

Optional. An AbortSignal to cancel the encryption.

Returns

Promise<T>


encryptMessage()

encryptMessage(clearString, options?): Promise<string>

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

Parameters

clearString: string

options?: Object

options.raw?: boolean

Optional. Whether to include or not the sessionID in the encrypted string. If set to true, the encrypted string cannot be used to retrieve the encryption session. Defaults to false.

Returns

Promise<string>


Generated using typedoc-plugin-markdown and TypeDoc