Class CipherSuite
java.lang.Object
org.metricshub.ipmi.core.coding.security.CipherSuite
Provides cipher suite (authentication, confidentiality and integrity
algorithms used during the session).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCipherSuite
(byte id, byte authenticationAlgorithm, byte confidentialityAlgorithm, byte integrityAlgorithm) -
Method Summary
Modifier and TypeMethodDescriptionReturns instance of AuthenticationAlgorithm class.static List<CipherSuite>
getCipherSuites
(byte[] bytes) Builds Cipher Suites collection from raw data received byGetChannelCipherSuites
commands.Returns instance of ConfidentialityAlgorithm class.static CipherSuite
getEmpty()
byte
getId()
Returns instance of IntegrityAlgorithm class.void
initializeAlgorithms
(byte[] sik) Initializes algorithms contained in thisCipherSuite
.static Mac
newMacInstance
(String algorithmName) Constructs a Mac object that implements the given MAC algorithm.
-
Field Details
-
NOT_YET_IMPLEMENTED_MESSAGE
- See Also:
-
-
Constructor Details
-
CipherSuite
public CipherSuite(byte id, byte authenticationAlgorithm, byte confidentialityAlgorithm, byte integrityAlgorithm)
-
-
Method Details
-
getId
public byte getId() -
initializeAlgorithms
public void initializeAlgorithms(byte[] sik) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException Initializes algorithms contained in thisCipherSuite
.- Parameters:
sik
- - Session Integrity Key calculated during the opening of the session or user password if 'one-key' logins are enabled.- Throws:
IllegalArgumentException
InvalidKeyException
- - when initiation of the algorithm failsNoSuchAlgorithmException
- - when initiation of the algorithm failsNoSuchPaddingException
- - when initiation of the algorithm fails
-
getAuthenticationAlgorithm
Returns instance of AuthenticationAlgorithm class.- Throws:
IllegalArgumentException
- when authentication algorithm code is incorrect.
-
getIntegrityAlgorithm
Returns instance of IntegrityAlgorithm class.- Throws:
IllegalArgumentException
- when integrity algorithm code is incorrect.
-
getConfidentialityAlgorithm
Returns instance of ConfidentialityAlgorithm class.- Throws:
IllegalArgumentException
- when confidentiality algorithm code is incorrect.
-
getCipherSuites
Builds Cipher Suites collection from raw data received byGetChannelCipherSuites
commands. Cannot be executed inGetChannelCipherSuitesResponseData
since data comes in 16-byte packets and is fragmented. Supports only one integrity and one confidentiality algorithm per suite.- Parameters:
bytes
- - concatenated Cipher Suite Records received byGetChannelCipherSuites
commands.- Returns:
- list of Cipher Suites supported by BMC.
-
getEmpty
- Returns:
CipherSuite
with algorithms set toAuthenticationRakpNone
,ConfidentialityNone
andIntegrityNone
.
-
newMacInstance
Constructs a Mac object that implements the given MAC algorithm.- Parameters:
algorithmName
- the name of the algorithm to use- Returns:
- The Mac object that implements the specified MAC algorithm.
-