org.gudy.bouncycastle.crypto.agreement.srp
Class SRP6Server
java.lang.Object
org.gudy.bouncycastle.crypto.agreement.srp.SRP6Server
public class SRP6Server
- extends Object
Implements the server side SRP-6a protocol. Note that this class is stateful, and therefore NOT threadsafe.
This implementation of SRP is based on the optimized message sequence put forth by Thomas Wu in the paper
"SRP-6: Improvements and Refinements to the Secure Remote Password Protocol, 2002"
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
N
protected BigInteger N
g
protected BigInteger g
v
protected BigInteger v
random
protected SecureRandom random
digest
protected Digest digest
A
protected BigInteger A
b
protected BigInteger b
B
protected BigInteger B
u
protected BigInteger u
S
protected BigInteger S
SRP6Server
public SRP6Server()
init
public void init(BigInteger N,
BigInteger g,
BigInteger v,
Digest digest,
SecureRandom random)
- Initialises the server to accept a new client authentication attempt
- Parameters:
N
- The safe prime associated with the client's verifierg
- The group parameter associated with the client's verifierv
- The client's verifierdigest
- The digest algorithm associated with the client's verifierrandom
- For key generation
generateServerCredentials
public BigInteger generateServerCredentials()
- Generates the server's credentials that are to be sent to the client.
- Returns:
- The server's public value to the client
calculateSecret
public BigInteger calculateSecret(BigInteger clientA)
throws CryptoException
- Processes the client's credentials. If valid the shared secret is generated and returned.
- Parameters:
clientA
- The client's credentials
- Returns:
- A shared secret BigInteger
- Throws:
CryptoException
- If client's credentials are invalid
selectPrivateValue
protected BigInteger selectPrivateValue()