Interface IEbicsCipher
Provides the cipher algorithm to help the EbicsTransaction to encrypt and decrypt data.
public interface IEbicsCipher
Methods
Decrypt(byte[], EbicsDataBuffer)
Decrypts the entire data buffer in place.
void Decrypt(byte[] vbTransactionKey, EbicsDataBuffer dBuffer)
Parameters
vbTransactionKey
byte[]Transaction key to be used for decrypting the data. Must not be
null
.dBuffer
EbicsDataBufferData buffer that contains encrypted data to be decrypted. Must not be
null
. The content and length of this buffer is modified and will hold the decrypted data on return.
Encrypt(byte[], EbicsDataBuffer)
Encrypts the entire data buffer in place.
void Encrypt(byte[] vbTransactionKey, EbicsDataBuffer dBuffer)
Parameters
vbTransactionKey
byte[]Transaction key to be used for encrypting the data. Must not be
null
.dBuffer
EbicsDataBufferData buffer that contains plain data to be encrypted. The data in this buffer will be replaced by the padded and encrypted data. Must not be
null
. The buffer is enlarged in order to hold the additional padding bytes.
Remarks
The provided buffer will be enlarged beyond its original length in order to accomodate any padding required by the cipher algorithm. Therefore, the caller should use PaddedLength(int) in order to create a buffer with sufficient capacity and avoid re-allocation.
GenerateTransactionKey()
Generates a new transaction key suitable for subsequent encryption.
byte[] GenerateTransactionKey()
Returns
- byte[]
The generated transaction key.
PaddedLength(int)
Computes the padded length of the encrypted data based on the plain data length.
int PaddedLength(int nLength)
Parameters
nLength
intPlain unencrypted byte length of the data that shall be encrypted.
Returns
- int
The byte length that is required in order to hold the padded and encrypted data of the given length.
Exceptions
- ArgumentOutOfRangeException
The given nLength was negative.