Options
All
  • Public
  • Public/Protected
  • All
Menu
internal

Base class for VirgilStreamCipher and VirgilStreamDecipher wrapping a low-level VirgilSeqCipher object.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

isFinished

isFinished: boolean = false

Indicates whether the final method has been called.

Protected seqCipher

seqCipher: WrappedVirgilSeqCipher

Instance of VirgilSeqCipher native class.

Methods

dispose

  • dispose(): void

final

  • final(dispose?: boolean): Buffer
  • Returns any remaining encrypted or decrypted data depending on current mode. Once final has been called, this instance cannot be used to encrypt or decrypt data, attempts to call any method including final will result in an error being thrown. This method also automatically calls dispose.

    Parameters

    • Default value dispose: boolean = true

      Optional. Indicating whether to automatically free the memory occupied by internal seqSigner object in the browser. Default is true. false is used to perform operations in inherited classes. If you pass false as an argument you should call dispose method manually.

      In node.js this argument is ignored because the memory will be freed by the garbage collector.

    Returns Buffer

update

  • update(data: Data, encoding?: StringEncoding): Buffer
  • Encrypt of decrypt chunk of data based on current mode.

    Parameters

    • data: Data

      Chunk of data to encrypt \ decrypt

    • Default value encoding: StringEncoding = "utf8"

      If data is a string, specifies its encoding, otherwise is ignored. Default is 'utf8'.

    Returns Buffer

    • Encrypted or decrypted chunk