Options
All
  • Public
  • Public/Protected
  • All
Menu

An encrypted attachment, usually created from Attachment.encrypt.

Hierarchy

  • EncryptedAttachment

Index

Constructors

  • new EncryptedAttachment(encrypted_data: Uint8Array, media_encryption_info: string): EncryptedAttachment
  • Create a new encrypted attachment manually.

    It needs encrypted data, stored in an Uint8Array, and a media encryption information, as a JSON-encoded string.

    The media encryption information aren't stored as a string: they are parsed, validated and fully deserialized.

    See the specification to learn more.

    Parameters

    • encrypted_data: Uint8Array
    • media_encryption_info: string

    Returns EncryptedAttachment

Properties

encryptedData: Uint8Array

The actual encrypted data.

Warning: It returns a copy of the entire encrypted data; be nice with your memory.

hasMediaEncryptionInfoBeenConsumed: boolean

Check whether the media encryption info has been consumed by Attachment.decrypt already.

mediaEncryptionInfo: undefined | string

Return the media encryption info as a JSON-encoded string. The structure is fully valid.

If the media encryption info have been consumed already, it will return null.

Methods

  • free(): void
  • Returns void

Generated using TypeDoc