org.bouncycastle.crypto.agreement.srp
public class SRP6Client extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.math.BigInteger |
a |
protected java.math.BigInteger |
A |
protected java.math.BigInteger |
B |
protected Digest |
digest |
protected java.math.BigInteger |
g |
protected java.math.BigInteger |
N |
protected java.security.SecureRandom |
random |
protected java.math.BigInteger |
S |
protected java.math.BigInteger |
u |
protected java.math.BigInteger |
x |
Constructor and Description |
---|
SRP6Client() |
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
calculateSecret(java.math.BigInteger serverB)
Generates client's verification message given the server's credentials
|
java.math.BigInteger |
generateClientCredentials(byte[] salt,
byte[] identity,
byte[] password)
Generates client's credentials given the client's salt, identity and password
|
void |
init(java.math.BigInteger N,
java.math.BigInteger g,
Digest digest,
java.security.SecureRandom random)
Initialises the client to begin new authentication attempt
|
protected java.math.BigInteger |
selectPrivateValue() |
protected java.math.BigInteger N
protected java.math.BigInteger g
protected java.math.BigInteger a
protected java.math.BigInteger A
protected java.math.BigInteger B
protected java.math.BigInteger x
protected java.math.BigInteger u
protected java.math.BigInteger S
protected Digest digest
protected java.security.SecureRandom random
public void init(java.math.BigInteger N, java.math.BigInteger g, Digest digest, java.security.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 java.math.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 java.math.BigInteger calculateSecret(java.math.BigInteger serverB) throws CryptoException
serverB
- The server's credentialsCryptoException
- If server's credentials are invalidprotected java.math.BigInteger selectPrivateValue()