Package org.yamcs.sle
Class Isp1Authentication
java.lang.Object
org.yamcs.sle.Isp1Authentication
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIsp1Authentication(String myUsername, byte[] myPass, String peerUsername, byte[] peerPass, String hashAlgorithm) -
Method Summary
Modifier and TypeMethodDescriptionvoiddebugAuth(boolean debugAuth) if set to true, authentication messages containing passwords will be logged at DEBUG level.longvoidsetMaxDeltaRcvTime(long maxDeltaRcvTime) Set the maximum delta between local time and received credential time used in theverifyCredentials(Credentials).voidverifyCredentials(Credentials credentials) Verify credentials and throw an exception if they are not correct.
-
Field Details
-
DEFAULT_MAX_DELTA_RCV_TIME_SEC
public static final int DEFAULT_MAX_DELTA_RCV_TIME_SEC- See Also:
-
-
Constructor Details
-
Isp1Authentication
-
-
Method Details
-
generateIsp1Credentials
-
generateCredentials
-
getMaxDeltaRcvTime
public long getMaxDeltaRcvTime() -
setMaxDeltaRcvTime
public void setMaxDeltaRcvTime(long maxDeltaRcvTime) Set the maximum delta between local time and received credential time used in theverifyCredentials(Credentials).- Parameters:
maxDeltaRcvTime- delta time in milliseconds
-
verifyCredentials
Verify credentials and throw an exception if they are not correct. This method usesSystem.currentTimeMillis()to get the time in milliseconds and compare it with the received time andmaxDeltaRcvTimeMillis.- Parameters:
credentials- the credentials to be verified- Throws:
AuthenticationException- in case the credentials do not match
-
getMyUsername
-
debugAuth
public void debugAuth(boolean debugAuth) if set to true, authentication messages containing passwords will be logged at DEBUG level.Do not forget to switch off!
- Parameters:
debugAuth-
-