public abstract class SRP6JavascriptServerSession extends Object
| Modifier and Type | Field and Description |
|---|---|
protected com.nimbusds.srp6.SRP6CryptoParams |
config
The crypto parameters for the SRP-6a protocol.
|
static int |
HASH_HEX_LENGTH
This must match the expected character length of the specified algorithm
|
protected com.nimbusds.srp6.SRP6ServerSession |
session
The underlying Nimbus session which will be configure for JavaScript
interactions
|
| Constructor and Description |
|---|
SRP6JavascriptServerSession(com.nimbusds.srp6.SRP6CryptoParams srp6CryptoParams)
Constructs a JavaScript compatible server session which configures an
underlying Nimbus SRP6ServerSession.
|
| Modifier and Type | Method and Description |
|---|---|
static BigInteger |
fromDecimal(String base10)
Turn a radix10 string into a java.net.BigInteger
|
String |
getPublicServerValue()
Gets the public server value 'B'.
|
String |
getSalt()
Gets the password salt 's'.
|
String |
getServerEvidenceMessage()
Gets the server evidence message 'M2'.
|
String |
getSessionKey(boolean doHash)
Gets the shared session key 'S' or its hash H(S).
|
String |
getState()
Returns the underlying session state as a String for JavaScript testing.
|
String |
getUserID()
Gets the identity 'I' of the authenticating user.
|
String |
k()
k is actually fixed and done with hash padding routine which uses
java.net.BigInteger byte array constructor so this is a convenience
method to get at the Java generated value to use in the configuration of
the Javascript
|
String |
step1(String username,
String salt,
String v)
Increments this SRP-6a authentication session to
SRP6ServerSession.State.STEP_1. |
String |
step2(String A,
String M1)
Increments this SRP-6a authentication session to
SRP6ServerSession.State.STEP_2. |
String |
toString()
Outputs the configuration in the way which can be used to configure
JavaScript.
|
protected final com.nimbusds.srp6.SRP6CryptoParams config
OpenSSLCryptoConfigprotected final com.nimbusds.srp6.SRP6ServerSession session
public static int HASH_HEX_LENGTH
public SRP6JavascriptServerSession(com.nimbusds.srp6.SRP6CryptoParams srp6CryptoParams)
srp6CryptoParams - cryptographic constants which must match those being used by
the client.public String step1(String username, String salt, String v)
SRP6ServerSession.State.STEP_1.username - The identity 'I' of the authenticating user. Must not be
null or empty.salt - The password salt 's'. Must not be null.v - The password verifier 'v'. Must not be null.IllegalStateException - If the mehod is invoked in a state other than
SRP6ServerSession.State.INIT.public String step2(String A, String M1) throws Exception
SRP6ServerSession.State.STEP_2.A - The client public value. Must not be null.M1 - The client evidence message. Must not be null.com.nimbusds.srp6.SRP6Exception - If the client public value 'A' is invalid or the user
credentials are invalid.IllegalStateException - If the mehod is invoked in a state other than
SRP6ServerSession.State.STEP_1.Exceptionpublic String getState()
public String getUserID()
public String k()
public static BigInteger fromDecimal(String base10)
base10 - the radix10 stringpublic String toString()
public String getSalt()
null.public String getPublicServerValue()
null.public String getServerEvidenceMessage()
null.public String getSessionKey(boolean doHash)
doHash - If true the hash H(S) of the session key will be
returned instead of the raw value.null will be
returned if authentication failed or the method is invoked in a
session state when the session key 'S' has not been computed yet.Copyright © 2015. All Rights Reserved.