TROCustomEncryption

Overview

This class provides settings for encrypting and decrypting communication at the channel level. It's available through the Encryption property on all channels and servers.

Location

 

constructor Create

Creates a new instance.

constructor Create

AssignTo  protected override

Copies the properties of an object to a destination object.

procedure AssignTo(Dest: TPersistent)

Parameters:

  • Dest: destination object.

Decrypt  virtual

procedure Decrypt(iCiphertext: TStream; iPlaintext: TStream)

Parameters:

  • iCiphertext:
  • iPlaintext:

Enclose  protected

procedure Enclose(const iSourceStream: TStream; const iDestStream: TStream; iEncMethod: TROEncryptionMethod; isCompressed: Boolean; iKey: Ansistring)

Parameters:

  • iSourceStream:
  • iDestStream:
  • iEncMethod:
  • isCompressed:
  • iKey:

Encrypt  virtual

Encrypts given stream

procedure Encrypt(iPlaintext: TStream; iCiphertext: TStream)

Parameters:

  • iPlaintext: Source
  • iCiphertext: Destination

EncryptionMethod

Specifies the encryption method to be used (default is tetNone, no encryption).

property EncryptionMethod: TROEncryptionMethod read write

EncryptionRecvKey

Specifies the key to be used for decrypting incoming messages.

property EncryptionRecvKey: TROCryptoKey read write

EncryptionSendKey

Specifies the key to be used for encrypting outgoing messages.

property EncryptionSendKey: TROCryptoKey read write

Extract  protected

function Extract(const iSourceStream: TStream; const iDestStream: TStream; iKey: Ansistring): Int64

Parameters:

  • iSourceStream:
  • iDestStream:
  • iKey:

isStreamEncrypted

Checks state of stream

class function isStreamEncrypted(aStream: TStream): Boolean

Parameters:

  • aStream: Stream

OnAfterDecryption

Fires after the decryption task has finished, giving you access to both the original (encrypted) and processed (decrypted) stream.

property OnAfterDecryption: TROEncryptionEvent read write
delegate: procedure OnAfterDecryption(Sender: TObject; OriginalStream: TStream; var ProcessedStream: TStream)

OnBeforeEncryption

Fires before the encryption task starts.

property OnBeforeEncryption: TROEncryptionEvent read write
delegate: procedure OnBeforeEncryption(Sender: TObject; OriginalStream: TStream; var ProcessedStream: TStream)

TriggerBeforeEncryptionEvent  protected virtual

procedure TriggerBeforeEncryptionEvent(iOriginalStream: TStream; var iProcessedStream: TStream)

Parameters:

  • iOriginalStream:
  • iProcessedStream:

UseCompression

Toggles whether outgoing messages will be automatically compressed if they exceed a specific size. Compression will only apply if the EncryptionMethod is set to a value other then tetNone.

property UseCompression: Boolean read write

 

EncryptionMethod

Specifies the encryption method to be used (default is tetNone, no encryption).

property EncryptionMethod: TROEncryptionMethod read write

EncryptionRecvKey

Specifies the key to be used for decrypting incoming messages.

property EncryptionRecvKey: TROCryptoKey read write

EncryptionSendKey

Specifies the key to be used for encrypting outgoing messages.

property EncryptionSendKey: TROCryptoKey read write

UseCompression

Toggles whether outgoing messages will be automatically compressed if they exceed a specific size. Compression will only apply if the EncryptionMethod is set to a value other then tetNone.

property UseCompression: Boolean read write

 

isStreamEncrypted

Checks state of stream

class function isStreamEncrypted(aStream: TStream): Boolean

Parameters:

  • aStream: Stream

 

constructor Create

Creates a new instance.

constructor Create

AssignTo  protected override

Copies the properties of an object to a destination object.

procedure AssignTo(Dest: TPersistent)

Parameters:

  • Dest: destination object.

Decrypt  virtual

procedure Decrypt(iCiphertext: TStream; iPlaintext: TStream)

Parameters:

  • iCiphertext:
  • iPlaintext:

Enclose  protected

procedure Enclose(const iSourceStream: TStream; const iDestStream: TStream; iEncMethod: TROEncryptionMethod; isCompressed: Boolean; iKey: Ansistring)

Parameters:

  • iSourceStream:
  • iDestStream:
  • iEncMethod:
  • isCompressed:
  • iKey:

Encrypt  virtual

Encrypts given stream

procedure Encrypt(iPlaintext: TStream; iCiphertext: TStream)

Parameters:

  • iPlaintext: Source
  • iCiphertext: Destination

Extract  protected

function Extract(const iSourceStream: TStream; const iDestStream: TStream; iKey: Ansistring): Int64

Parameters:

  • iSourceStream:
  • iDestStream:
  • iKey:

TriggerBeforeEncryptionEvent  protected virtual

procedure TriggerBeforeEncryptionEvent(iOriginalStream: TStream; var iProcessedStream: TStream)

Parameters:

  • iOriginalStream:
  • iProcessedStream:

 

OnAfterDecryption

Fires after the decryption task has finished, giving you access to both the original (encrypted) and processed (decrypted) stream.

property OnAfterDecryption: TROEncryptionEvent read write
delegate: procedure OnAfterDecryption(Sender: TObject; OriginalStream: TStream; var ProcessedStream: TStream)

OnBeforeEncryption

Fires before the encryption task starts.

property OnBeforeEncryption: TROEncryptionEvent read write
delegate: procedure OnBeforeEncryption(Sender: TObject; OriginalStream: TStream; var ProcessedStream: TStream)

Descendants