Class AuthenticationAlgorithm
java.lang.Object
org.metricshub.ipmi.core.coding.security.AuthenticationAlgorithm
- Direct Known Subclasses:
AuthenticationRakpHmacMd5,AuthenticationRakpHmacSha1,AuthenticationRakpHmacSha256,AuthenticationRakpNone
Interface for authentication algorithms. All classes extending this one must
have a parameterless constructor.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckKeyExchangeAuthenticationCode(byte[] data, byte[] key, String password) Checks value of the Key Exchange Authentication Code in RAKP messagesbooleandoIntegrityCheck(byte[] data, byte[] reference, byte[] sik) Validates Integrity Check Value in RAKP Message 4.abstract Stringabstract bytegetCode()abstract intbyte[]getKeyExchangeAuthenticationCode(byte[] data, String password) Calculates value of the Key Exchange Authentication Code in RAKP messagesabstract int
-
Method Details
-
getCode
public abstract byte getCode()- Returns:
- algorithm-specific code
-
getKeyLength
public abstract int getKeyLength()- Returns:
- length of the key for the RAKP2 message
-
getIntegrityCheckBaseLength
public abstract int getIntegrityCheckBaseLength()- Returns:
- length of the integrity check base for RAKP4 message
-
checkKeyExchangeAuthenticationCode
public boolean checkKeyExchangeAuthenticationCode(byte[] data, byte[] key, String password) throws NoSuchAlgorithmException, InvalidKeyException Checks value of the Key Exchange Authentication Code in RAKP messages- Parameters:
data- - The base for authentication algorithm. Depends on RAKP Message.key- - the Key Exchange Authentication Code to check.password- - password of the user establishing a session- Returns:
- True if authentication check was successful, false otherwise.
- Throws:
NoSuchAlgorithmException- when initiation of the algorithm failsInvalidKeyException- when creating of the algorithm key fails
-
getKeyExchangeAuthenticationCode
public byte[] getKeyExchangeAuthenticationCode(byte[] data, String password) throws NoSuchAlgorithmException, InvalidKeyException Calculates value of the Key Exchange Authentication Code in RAKP messages- Parameters:
data- - The base for authentication algorithm. Depends on RAKP Message.password- - password of the user establishing a session- Throws:
NoSuchAlgorithmException- when initiation of the algorithm failsInvalidKeyException- when creating of the algorithm key fails
-
doIntegrityCheck
public boolean doIntegrityCheck(byte[] data, byte[] reference, byte[] sik) throws InvalidKeyException, NoSuchAlgorithmException Validates Integrity Check Value in RAKP Message 4.- Parameters:
data- - The base for authentication algorithm.reference- - The Integrity Check Value to validate.sik- - The Session Integrity Key generated on base of RAKP Messages 1 and 2.- Returns:
- True if integrity check was successful, false otherwise.
- Throws:
NoSuchAlgorithmException- when initiation of the algorithm failsInvalidKeyException- when creating of the algorithm key fails- See Also:
-
getAlgorithmName
- Returns:
- the name of the algorithm as a
String.
-