Class ConfidentialityAlgorithm
java.lang.Object
org.sentrysoftware.ipmi.core.coding.security.ConfidentialityAlgorithm
- Direct Known Subclasses:
ConfidentialityAesCbc128
,ConfidentialityNone
Interface for Confidentiality Algorithms. All classes extending this one must
implement constructor(byte[]).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract byte[]
decrypt
(byte[] data) Decrypts the data.abstract byte[]
encrypt
(byte[] data) Encrypts the data.abstract byte
getCode()
Returns the algorithm's ID.abstract int
getConfidentialityOverheadSize
(int payloadSize) Calculates size of the confidentiality header and trailer specific for the algorithm.void
initialize
(byte[] sik) Initializes Confidentiality Algorithm
-
Constructor Details
-
ConfidentialityAlgorithm
public ConfidentialityAlgorithm()
-
-
Method Details
-
initialize
public void initialize(byte[] sik) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException Initializes Confidentiality Algorithm- Parameters:
sik
- - Session Integrity Key calculated during the opening of the session or user password if 'one-key' logins are enabled.- Throws:
InvalidKeyException
- - when initiation of the algorithm failsNoSuchAlgorithmException
- - when initiation of the algorithm failsNoSuchPaddingException
- - when initiation of the algorithm fails
-
getCode
public abstract byte getCode()Returns the algorithm's ID. -
encrypt
Encrypts the data.- 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 abstract byte[] decrypt(byte[] data) Decrypts the data.- Parameters:
data
- - encrypted data encapsulated in COnfidentiality Header and Trailer.- Returns:
- decrypted data.
- Throws:
IllegalArgumentException
- - when initiation of the algorithm fails
-
getConfidentialityOverheadSize
public abstract int getConfidentialityOverheadSize(int payloadSize) Calculates size of the confidentiality header and trailer specific for the algorithm.- Parameters:
payloadSize
- - size of the data that will be encrypted
-