Package org.yamcs.sle
Class Isp1Authentication
- java.lang.Object
-
- org.yamcs.sle.Isp1Authentication
-
public class Isp1Authentication extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIsp1Authentication.HashAlgorithm
-
Constructor Summary
Constructors Constructor Description Isp1Authentication(String myUsername, byte[] myPass, String peerUsername, byte[] peerPass, String hashAlgorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddebugAuth(boolean debugAuth)if set to true, authentication messages containing passwords will be logged at DEBUG level.CredentialsgenerateCredentials()ISP1CredentialsgenerateIsp1Credentials()longgetMaxDeltaRcvTime()StringgetMyUsername()voidsetMaxDeltaRcvTime(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.
-
-
-
Method Detail
-
generateIsp1Credentials
public ISP1Credentials generateIsp1Credentials()
-
generateCredentials
public Credentials 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
public void verifyCredentials(Credentials credentials) throws AuthenticationException
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 andmaxDeltaRcvTime.- Parameters:
credentials- the credentials to be verified- Throws:
AuthenticationException- in case the credentials do not match
-
getMyUsername
public String 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-
-
-