com.eruces.teagent.TEAgent
The TEAgent class is an abstract class containing the common cryptographic functions and the Key Service Agent settings.
Inheritance
- Inherits com.eruces.teagent.IConnection
- Inherited by com.eruces.teagent.TEAgentFile
- Inherited by com.eruces.teagent.TEAgentMatrix
- Inherited by com.eruces.teagent.TEAgentResultSet
Static Public Attributes
| Type | Name | Description |
|---|---|---|
| final short | ENCRYPTION | The ENCRYPTION field is a constant value for the operation type. |
| final short | DECRYPTION | The DECRYPTION field is a constant value for the operation type. |
Public Member Functions
| Member | Description |
|---|---|
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
| Member | Description |
|---|---|
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
| Parameter | Description |
|---|---|
conn | A 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
| Parameter | Description |
|---|---|
szData | A byte array representing data to be encrypted. |
szHL | A 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
| Parameter | Description |
|---|---|
szData | A byte array representing data to be encrypted. |
szHL | A 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
| Parameter | Description |
|---|---|
strData | A string representing the data to be hashed. |
strSalt | A 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
| Parameter | Description |
|---|---|
byteData | A byte array representing the data to be hashed. |
byteSalt | A 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
| Parameter | Description |
|---|---|
conn | An TEAgentConnection object. |
szData | A byte array representing data to be encrypted. |
szHL | A 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
| Parameter | Description |
|---|---|
conn | An TEAgentConnection object. |
szData | A byte array representing data to be encrypted. |
szHL | A byte array representing a TTag. |
szIV | A byte array representing the IV. |
bHLEncoded | A 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
| Parameter | Description |
|---|---|
conn | An TEAgentConnection object. |
szData | A byte array representing data to be encrypted. |
szHL | A 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
| Parameter | Description |
|---|---|
conn | An TEAgentConnection object. |
szData | A byte array representing data to be encrypted. |
szHL | A byte array representing a TTag. |
szIV | A byte array representing the IV. |
bHLEncoded | A 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
| Parameter | Description |
|---|---|
algorithm | The encryption algorithm to use. AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC |
data | A 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
| Parameter | Description |
|---|---|
algorithm | The encryption algorithm to use. AES_CBC_128, AES_CBC_192, AES_CBC_256, BF_CBC |
data | A 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