public class Isp1Authentication extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Isp1Authentication.HashAlgorithm |
| Constructor and Description |
|---|
Isp1Authentication(String myUsername,
byte[] myPass,
String peerUsername,
byte[] peerPass,
String hashAlgorithm) |
| Modifier and Type | Method and Description |
|---|---|
void |
debugAuth(boolean debugAuth)
if set to true, authentication messages containing passwords will be logged at DEBUG level.
|
Credentials |
generateCredentials() |
ISP1Credentials |
generateIsp1Credentials() |
long |
getMaxDeltaRcvTime() |
String |
getMyUsername() |
void |
setMaxDeltaRcvTime(long maxDeltaRcvTime)
Set the maximum delta between local time and received credential time used in the
verifyCredentials(Credentials). |
void |
verifyCredentials(Credentials credentials)
Verify credentials and throw an exception if they are not correct.
|
public ISP1Credentials generateIsp1Credentials()
public Credentials generateCredentials()
public long getMaxDeltaRcvTime()
public void setMaxDeltaRcvTime(long maxDeltaRcvTime)
verifyCredentials(Credentials).maxDeltaRcvTime - delta time in millisecondspublic void verifyCredentials(Credentials credentials) throws AuthenticationException
System.currentTimeMillis() to get the time in milliseconds and compare it with the
received time and maxDeltaRcvTime.credentials - the credentials to be verifiedAuthenticationException - in case the credentials do not matchpublic String getMyUsername()
public void debugAuth(boolean debugAuth)
Do not forget to switch off!
debugAuth - Copyright © 2020 Space Applications Services. All rights reserved.