SENxContext Class

A security context class that provides encryption and decryption services.

public class SENxContext

CONSTRUCTORS

Name

Description

:small-blue-diamond:

SENxContext(CryptoAlgorithm crypto, HashAlgorithm hash)

Initializes a SENxContext instance using the specified CryptoAlgorithm (cipher) and HashAlgorithm.

PROPERTIES

Name

Description

Error

Contains the result/error of the last operation.

ErrorMessage

Contains the error message of the last operation.

HasPrivateKey

A bool indicating whether a private key has been loaded.

HasPublicKey

A bool indicating whether a public key has been loaded.

KeySize

An integer representing the key size (in bits) of the currently loaded key.

METHODS

Name

Description

:small-blue-diamond:

FromCryptogram(byte[] cryptogram)

Creates a SENxContext instance from the Cryptogram byte array parameter.

:small-blue-diamond:

Decrypt(byte[] cryptogram)

Decrypts the array of bytes representing the cryptogram into its original contents.

:small-blue-diamond:

Dispose()

Disposes the SENxContext instance. This method also implicitly calls the FreeContext() method.

:small-blue-diamond:

Encrypt(byte[] clearText)

Encrypts the array of bytes into a cryptogram that may be transmitted using the EtherFaxClient SendFax() method.

:small-blue-diamond:

FreeContext()

Releases all resources allocated by this instance.

:small-blue-diamond:

IsCryptogram(byte[] cryptogram)

Returns a bool if the byte[] array contains a valid cryptogram.

:small-blue-diamond:

LoadKeyFromBuffer(byte[] keyBuffer)

Loads the public or private key (PEM) from a byte[] buffer.

:small-blue-diamond:

LoadKeyFromFile(string keyFIle)

Loads the public or private key (PEM) from a file.