Skip to main content

com.eruces.teagent.TEAgent

The TEAgent class is an abstract class containing the common cryptographic functions and the Key Service Agent settings.

Inheritance

Static Public Attributes

TypeNameDescription
final shortENCRYPTIONThe ENCRYPTION field is a constant value for the operation type.
final shortDECRYPTIONThe DECRYPTION field is a constant value for the operation type.

Public Member Functions

MemberDescription
TEAgent()The TEAgent constructor is the default constructor for the TEAgent class.
TEAgent(TEAgentConnection conn)The TEAgent constructor constructs a connection object with a connection.
abstract void encrypt()The encrypt method encrypts data.
abstract void decrypt()The decrypt method decrypts data.
synchronized byte[] encryptBuffer(byte[] szData, byte[][] szHL)The encryptBuffer method encrypts a buffer.
synchronized byte[] decryptBuffer(byte[] szData, byte[] szHL)The decryptBuffer method decrypts a buffer.
synchronized void reset()The reset method resets the status of a TEAgent object.

Static Public Member Functions

MemberDescription
String performHash(String strData, String strSalt)The performHash method hashes data with SHA-256 (performHash v2).
byte[] performHash(byte[] byteData, byte[] byteSalt)The performHash method hashes data with SHA-256 (performHash v2).
synchronized byte[] encryptBuffer(TEAgentConnection conn, byte[] szData, byte[][] szHL)The encryptBuffer method encrypts a buffer.
synchronized byte[] encryptBuffer(TEAgentConnection conn, byte[] szData, byte[][] szHL, byte[] szIV, boolean bHLEncoded)The encryptBuffer method encrypts a buffer.
synchronized byte[] decryptBuffer(TEAgentConnection conn, byte[] szData, byte[] szHL)The decryptBuffer method decrypts a buffer.
synchronized byte[] decryptBuffer(TEAgentConnection conn, byte[] szData, byte[] szHL, byte[] szIV, boolean bHLEncoded)The decryptBuffer method decrypts a buffer.
byte[] encryptBuffer(TECipher algorithm, byte[] data)The encryptBuffer method encrypts a buffer.
byte[] decryptBuffer(TECipher algorithm, byte[] data)The decryptBuffer method decrypts a buffer.

Member Function Documentation

TEAgent()

The TEAgent constructor is the default constructor for the TEAgent class.

TEAgent(TEAgentConnection conn)

The TEAgent constructor constructs a connection object with a connection.

Parameters

ParameterDescription
connA TEAgentConnection object.

abstract void encrypt()

The encrypt method encrypts data.

abstract void decrypt()

The decrypt method decrypts data.

synchronized byte[] encryptBuffer(byte[] szData, byte[][] szHL)

The encryptBuffer method encrypts a buffer.

Parameters

ParameterDescription
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.

Returns: A byte array representing the encrypted data.

synchronized byte[] decryptBuffer(byte[] szData, byte[] szHL)

The decryptBuffer method decrypts a buffer.

Parameters

ParameterDescription
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.

Returns: A byte array representing the decrypted buffer.

synchronized void reset()

The reset method resets the status of a TEAgent object.

String performHash(String strData, String strSalt)

The performHash method hashes data with SHA-256 (performHash v2).

v1 (SHA-1/MD5) outputs do not match v2 outputs; there is no compatibility mode. Note: performHash provides integrity/searchability, not strong pseudonymization of low-entropy data; for that, use a keyed construction (see the keyed-API roadmap note).

Parameters

ParameterDescription
strDataA string representing the data to be hashed.
strSaltA string representing the salt to be used for hashing.

Returns: A string representing the hashed data (Based 64 encoded).

byte[] performHash(byte[] byteData, byte[] byteSalt)

The performHash method hashes data with SHA-256 (performHash v2).

v1 (SHA-1/MD5) outputs do not match v2 outputs; there is no compatibility mode. Note: performHash provides integrity/searchability, not strong pseudonymization of low-entropy data; for that, use a keyed construction (see the keyed-API roadmap note).

Parameters

ParameterDescription
byteDataA byte array representing the data to be hashed.
byteSaltA byte array representing the salt to be used for hashing.

Returns: A byte array representing the hashed data (unencoded).

synchronized byte[] encryptBuffer(TEAgentConnection conn, byte[] szData, byte[][] szHL)

The encryptBuffer method encrypts a buffer.

Parameters

ParameterDescription
connAn TEAgentConnection object.
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.

Returns: A byte array representing the encrypted data.

synchronized byte[] encryptBuffer(TEAgentConnection conn, byte[] szData, byte[][] szHL, byte[] szIV, boolean bHLEncoded)

The encryptBuffer method encrypts a buffer.

Parameters

ParameterDescription
connAn TEAgentConnection object.
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.
szIVA byte array representing the IV.
bHLEncodedA boolean representing whether or not the data is Base64 encoded.

Returns: A byte array representing the encrypted data.

synchronized byte[] decryptBuffer(TEAgentConnection conn, byte[] szData, byte[] szHL)

The decryptBuffer method decrypts a buffer.

Parameters

ParameterDescription
connAn TEAgentConnection object.
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.

Returns: A byte array representing the decrypted buffer.

synchronized byte[] decryptBuffer(TEAgentConnection conn, byte[] szData, byte[] szHL, byte[] szIV, boolean bHLEncoded)

The decryptBuffer method decrypts a buffer.

Parameters

ParameterDescription
connAn TEAgentConnection object.
szDataA byte array representing data to be encrypted.
szHLA byte array representing a TTag.
szIVA byte array representing the IV.
bHLEncodedA boolean representing whether or not the data is Base64 encoded.

Returns: A byte array representing the decrypted buffer.

byte[] encryptBuffer(TECipher algorithm, byte[] data)

The encryptBuffer method encrypts a buffer.

Parameters

ParameterDescription
algorithmThe encryption algorithm to use. AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC
dataA byte array representing data to be encrypted.

Returns: Returns a string representing the encrypted data.

See also: TECipher, AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC

byte[] decryptBuffer(TECipher algorithm, byte[] data)

The decryptBuffer method decrypts a buffer.

Parameters

ParameterDescription
algorithmThe encryption algorithm to use. AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC
dataA byte array representing data to be decrypted.

Returns: A byte array representing the decrypted buffer.

See also: TECipher, AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC