public class ConfidentialityAesCbc128 extends ConfidentialityAlgorithm
Constructor and Description |
---|
ConfidentialityAesCbc128() |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] data)
Decrypts the data.
|
byte[] |
encrypt(byte[] data)
Encrypts the data.
|
byte |
getCode()
Returns the algorithm's ID.
|
int |
getConfidentialityOverheadSize(int payloadSize)
Calculates size of the confidentiality header and trailer specific for
the algorithm.
|
void |
initialize(byte[] sik)
Initializes Confidentiality Algorithm
|
public byte getCode()
ConfidentialityAlgorithm
getCode
in class ConfidentialityAlgorithm
public void initialize(byte[] sik) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException
ConfidentialityAlgorithm
initialize
in class ConfidentialityAlgorithm
sik
- - Session Integrity Key calculated during the opening of the
session or user password if 'one-key' logins are enabled.java.security.InvalidKeyException
- - when initiation of the algorithm failsjava.security.NoSuchAlgorithmException
- - when initiation of the algorithm failsjavax.crypto.NoSuchPaddingException
- - when initiation of the algorithm failspublic byte[] encrypt(byte[] data) throws java.security.InvalidKeyException
ConfidentialityAlgorithm
encrypt
in class ConfidentialityAlgorithm
data
- - payload to be encryptedjava.security.InvalidKeyException
- - when initiation of the algorithm failspublic byte[] decrypt(byte[] data) throws java.lang.IllegalArgumentException
ConfidentialityAlgorithm
decrypt
in class ConfidentialityAlgorithm
data
- - encrypted data encapsulated in COnfidentiality Header and
Trailer.java.lang.IllegalArgumentException
- - when initiation of the algorithm failspublic int getConfidentialityOverheadSize(int payloadSize)
ConfidentialityAlgorithm
getConfidentialityOverheadSize
in class ConfidentialityAlgorithm
payloadSize
- - size of the data that will be encrypted