Class ConfidentialityAesCbc128
java.lang.Object
org.metricshub.ipmi.core.coding.security.ConfidentialityAlgorithm
org.metricshub.ipmi.core.coding.security.ConfidentialityAesCbc128
AES-CBC-128 confidentiality algorithm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
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, AuthenticationAlgorithm authenticationAlgorithm) Initializes Confidentiality Algorithm
-
Constructor Details
-
ConfidentialityAesCbc128
public ConfidentialityAesCbc128()
-
-
Method Details
-
getCode
public byte getCode()Description copied from class:ConfidentialityAlgorithm
Returns the algorithm's ID.- Specified by:
getCode
in classConfidentialityAlgorithm
-
initialize
public void initialize(byte[] sik, AuthenticationAlgorithm authenticationAlgorithm) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException Description copied from class:ConfidentialityAlgorithm
Initializes Confidentiality Algorithm- Overrides:
initialize
in classConfidentialityAlgorithm
- Parameters:
sik
- - Session Integrity Key calculated during the opening of the session or user password if 'one-key' logins are enabled.authenticationAlgorithm
- - Algorithm used for authentication.- Throws:
InvalidKeyException
- - when initiation of the algorithm failsNoSuchAlgorithmException
- - when initiation of the algorithm failsNoSuchPaddingException
- - when initiation of the algorithm fails
-
encrypt
Description copied from class:ConfidentialityAlgorithm
Encrypts the data.- Specified by:
encrypt
in classConfidentialityAlgorithm
- Parameters:
data
- - payload to be encrypted- Returns:
- encrypted data encapsulated in COnfidentiality Header and Trailer.
- Throws:
InvalidKeyException
- - when initiation of the algorithm fails
-
decrypt
public byte[] decrypt(byte[] data) Description copied from class:ConfidentialityAlgorithm
Decrypts the data.- Specified by:
decrypt
in classConfidentialityAlgorithm
- Parameters:
data
- - encrypted data encapsulated in COnfidentiality Header and Trailer.- Returns:
- decrypted data.
-
getConfidentialityOverheadSize
public int getConfidentialityOverheadSize(int payloadSize) Description copied from class:ConfidentialityAlgorithm
Calculates size of the confidentiality header and trailer specific for the algorithm.- Specified by:
getConfidentialityOverheadSize
in classConfidentialityAlgorithm
- Parameters:
payloadSize
- - size of the data that will be encrypted
-