|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nimbusds.srp6.SRP6Session
com.nimbusds.srp6.SRP6ClientSession
public class SRP6ClientSession
Stateful client-side Secure Remote Password (SRP-6a) authentication session. Handles the computing and storing of SRP-6a variables between the protocol steps as well as timeouts.
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'.
| Nested Class Summary | |
|---|---|
static class |
SRP6ClientSession.State
Enumerates the states of a client-side SRP-6a authentication session. |
| Field Summary |
|---|
| Fields inherited from class com.nimbusds.srp6.SRP6Session |
|---|
A, B, clientEvidenceRoutine, config, digest, k, lastActivity, M1, M2, random, s, S, serverEvidenceRoutine, timeout, u, userID |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
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(java.lang.String userID,
java.lang.String password)
Records the identity 'I' and password 'P' of the authenticating user. |
SRP6ClientCredentials |
step2(SRP6CryptoParams config,
java.math.BigInteger s,
java.math.BigInteger B)
Receives the password salt 's' and public value 'B' from the server. |
void |
step3(java.math.BigInteger M2)
Receives the server evidence message 'M1'. |
| Methods inherited from class com.nimbusds.srp6.SRP6Session |
|---|
getAttribute, getClientEvidenceMessage, getClientEvidenceRoutine, getCryptoParams, getLastActivityTime, getPublicClientValue, getPublicServerValue, getSalt, getServerEvidenceMessage, getServerEvidenceRoutine, getSessionKey, getTimeout, getUserID, hasTimedOut, setAttribute, setClientEvidenceRoutine, setServerEvidenceRoutine, updateLastActivityTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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.
| Method Detail |
|---|
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(java.lang.String userID,
java.lang.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.
java.lang.IllegalStateException - If the mehod is invoked in a state
other than SRP6ClientSession.State.INIT.
public SRP6ClientCredentials step2(SRP6CryptoParams config,
java.math.BigInteger s,
java.math.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.
java.lang.IllegalStateException - If the mehod 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(java.math.BigInteger M2)
throws SRP6Exception
SRP6ClientSession.State.STEP_3.
Argument origin:
M2 - The server evidence message 'M2'. Must not be null.
java.lang.IllegalStateException - If the mehod 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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||