SENxContext Class

A security context class that provides encryption and decryption services.

public class SENxContext

CONSTRUCTORS

NameDescription
🔹SENxContext(CryptoAlgorithm crypto, HashAlgorithm hash)Initializes a SENxContext instance using the specified CryptoAlgorithm (cipher) and HashAlgorithm.

PROPERTIES

NameDescription
ErrorContains the result/error of the last operation.
ErrorMessageContains the error message of the last operation.
HasPrivateKeyA bool indicating whether a private key has been loaded.
HasPublicKeyA bool indicating whether a public key has been loaded.
KeySizeAn integer representing the key size (in bits) of the currently loaded key.

METHODS

NameDescription
🔹FromCryptogram(byte[] cryptogram)Creates a SENxContext instance from the Cryptogram byte array parameter.
🔹Decrypt(byte[] cryptogram)Decrypts the array of bytes representing the cryptogram into its original contents.
🔹Dispose()Disposes the SENxContext instance. This method also implicitly calls the FreeContext() method.
🔹Encrypt(byte[] clearText)Encrypts the array of bytes into a cryptogram that may be transmitted using the EtherFaxClient SendFax() method.
🔹FreeContext()Releases all resources allocated by this instance.
🔹IsCryptogram(byte[] cryptogram)Returns a bool if the byte[] array contains a valid cryptogram.
🔹LoadKeyFromBuffer(byte[] keyBuffer)Loads the public or private key (PEM) from a byte[] buffer.
🔹LoadKeyFromFile(string keyFIle)Loads the public or private key (PEM) from a file.