public class SRP6Client extends Object
| Modifier and Type | Field and Description |
|---|---|
protected BigInteger |
a |
protected BigInteger |
A |
protected BigInteger |
B |
protected Digest |
digest |
protected BigInteger |
g |
protected BigInteger |
Key |
protected BigInteger |
M1 |
protected BigInteger |
M2 |
protected BigInteger |
N |
protected SecureRandom |
random |
protected BigInteger |
S |
protected BigInteger |
u |
protected BigInteger |
x |
| Constructor and Description |
|---|
SRP6Client() |
| Modifier and Type | Method and Description |
|---|---|
BigInteger |
calculateClientEvidenceMessage()
Computes the client evidence message M1 using the previously received values.
|
BigInteger |
calculateSecret(BigInteger serverB)
Generates the secret S given the server's credentials
|
BigInteger |
calculateSessionKey()
Computes the final session key as a result of the SRP successful mutual authentication
To be called after verifying the server evidence message M2.
|
BigInteger |
generateClientCredentials(byte[] salt,
byte[] identity,
byte[] password)
Generates client's credentials given the client's salt, identity and password
|
void |
init(BigInteger N,
BigInteger g,
Digest digest,
SecureRandom random)
Initialises the client to begin new authentication attempt
|
void |
init(SRP6GroupParameters group,
Digest digest,
SecureRandom random) |
protected BigInteger |
selectPrivateValue() |
boolean |
verifyServerEvidenceMessage(BigInteger serverM2)
Authenticates the server evidence message M2 received and saves it only if correct.
|
protected BigInteger N
protected BigInteger g
protected BigInteger a
protected BigInteger A
protected BigInteger B
protected BigInteger x
protected BigInteger u
protected BigInteger S
protected BigInteger M1
protected BigInteger M2
protected BigInteger Key
protected Digest digest
protected SecureRandom random
public void init(BigInteger N, BigInteger g, Digest digest, SecureRandom random)
N - The safe prime associated with the client's verifierg - The group parameter associated with the client's verifierdigest - The digest algorithm associated with the client's verifierrandom - For key generationpublic void init(SRP6GroupParameters group, Digest digest, SecureRandom random)
public BigInteger generateClientCredentials(byte[] salt, byte[] identity, byte[] password)
salt - The salt used in the client's verifier.identity - The user's identity (eg. username)password - The user's passwordpublic BigInteger calculateSecret(BigInteger serverB) throws CryptoException
serverB - The server's credentialsCryptoException - If server's credentials are invalidprotected BigInteger selectPrivateValue()
public BigInteger calculateClientEvidenceMessage() throws CryptoException
CryptoExceptionpublic boolean verifyServerEvidenceMessage(BigInteger serverM2) throws CryptoException
serverM2 - the server side generated evidence messageCryptoExceptionpublic BigInteger calculateSessionKey() throws CryptoException
CryptoExceptionCopyright © 2015–2019 The veraPDF Consortium. All rights reserved.