public class SRP6ClientSession extends SRP6Session
Usage:
step one
by recording the input user
identity 'I' (submitted to the server) and password 'P'.
step two
on receiving the password salt
's' and the public server value 'B' from the server. At this point
the SRP-6a crypto parameters 'N', 'g' and 'H' must also be
specified. These can either be agreed in advance between server and
client or suggested by the server in its step one response.
step three
on receiving the server
evidence message 'M2'.
Modifier and Type | Class and Description |
---|---|
static class |
SRP6ClientSession.State
Enumerates the states of a client-side SRP-6a authentication
session.
|
A, B, clientEvidenceRoutine, config, digest, hashedKeysRoutine, k, lastActivity, M1, M2, random, s, S, serverEvidenceRoutine, timeout, u, userID
Constructor and Description |
---|
SRP6ClientSession()
Creates a new client-side SRP-6a authentication session and sets its
state to
SRP6ClientSession.State.INIT . |
SRP6ClientSession(int timeout)
Creates a new client-side SRP-6a authentication session and sets its
state to
SRP6ClientSession.State.INIT . |
Modifier and Type | Method and Description |
---|---|
SRP6ClientSession.State |
getState()
Returns the current state of this SRP-6a authentication session.
|
XRoutine |
getXRoutine()
Gets the custom routine for the password key 'x' computation.
|
void |
setXRoutine(XRoutine routine)
Sets a custom routine for the password key 'x' computation.
|
void |
step1(String userID,
String password)
Records the identity 'I' and password 'P' of the authenticating
user.
|
SRP6ClientCredentials |
step2(SRP6CryptoParams config,
BigInteger s,
BigInteger B)
Receives the password salt 's' and public value 'B' from the server.
|
void |
step3(BigInteger M2)
Receives the server evidence message 'M1'.
|
getAttribute, getClientEvidenceMessage, getClientEvidenceRoutine, getCryptoParams, getHashedKeysRoutine, getLastActivityTime, getPublicClientValue, getPublicServerValue, getSalt, getServerEvidenceMessage, getServerEvidenceRoutine, getSessionKey, getTimeout, getUserID, hasTimedOut, setAttribute, setClientEvidenceRoutine, setHashedKeysRoutine, setServerEvidenceRoutine, updateLastActivityTime
public SRP6ClientSession(int timeout)
SRP6ClientSession.State.INIT
.timeout
- The SRP-6a authentication session timeout in seconds.
If the authenticating counterparty (server or client)
fails to respond within the specified time the session
will be closed. If zero timeouts are disabled.public SRP6ClientSession()
SRP6ClientSession.State.INIT
. Session timeouts are disabled.public void setXRoutine(XRoutine routine)
SRP6ClientSession.State.STEP_2
.routine
- The password key 'x' routine or null
to use
the default one
instead.public XRoutine getXRoutine()
null
if the default
default one
is used.public void step1(String userID, String password)
SRP6ClientSession.State.STEP_1
.
Argument origin:
userID
- The identity 'I' of the authenticating user, UTF-8
encoded. Must not be null
or empty.password
- The user password 'P', UTF-8 encoded. Must not be
null
.IllegalStateException
- If the method is invoked in a state
other than SRP6ClientSession.State.INIT
.public SRP6ClientCredentials step2(SRP6CryptoParams config, BigInteger s, BigInteger B) throws SRP6Exception
SRP6ClientSession.State.STEP_2
.
Argument origin:
config
- The SRP-6a crypto parameters. Must not be null
.s
- The password salt 's'. Must not be null
.B
- The public server value 'B'. Must not be null
.IllegalStateException
- If the method is invoked in a state
other than SRP6ClientSession.State.STEP_1
.SRP6Exception
- If the session has timed out or the
public server value 'B' is invalid.public void step3(BigInteger M2) throws SRP6Exception
SRP6ClientSession.State.STEP_3
.
Argument origin:
M2
- The server evidence message 'M2'. Must not be
null
.IllegalStateException
- If the method is invoked in a state
other than SRP6ClientSession.State.STEP_2
.SRP6Exception
- If the session has timed out or the
server evidence message 'M2' is
invalid.public SRP6ClientSession.State getState()
Copyright © 2014 Connect2id Ltd.. All Rights Reserved.