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 byGetChannelCipherSuitescommands.Returns instance of ConfidentialityAlgorithm class.static CipherSuitegetEmpty()bytegetId()Returns instance of IntegrityAlgorithm class.voidinitializeAlgorithms(byte[] sik) Initializes algorithms contained in thisCipherSuite.static MacnewMacInstance(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:
IllegalArgumentExceptionInvalidKeyException- - 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 byGetChannelCipherSuitescommands. Cannot be executed inGetChannelCipherSuitesResponseDatasince 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 byGetChannelCipherSuitescommands.- Returns:
- list of Cipher Suites supported by BMC.
-
getEmpty
- Returns:
CipherSuitewith algorithms set toAuthenticationRakpNone,ConfidentialityNoneandIntegrityNone.
-
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.
-