|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bouncycastle.crypto.agreement.srp.SRP6Server
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"
Field Summary | |
protected java.math.BigInteger |
A
|
protected java.math.BigInteger |
b
|
protected java.math.BigInteger |
B
|
protected Digest |
digest
|
protected java.math.BigInteger |
g
|
protected java.math.BigInteger |
Key
|
protected java.math.BigInteger |
M1
|
protected java.math.BigInteger |
M2
|
protected java.math.BigInteger |
N
|
protected java.security.SecureRandom |
random
|
protected java.math.BigInteger |
S
|
protected java.math.BigInteger |
u
|
protected java.math.BigInteger |
v
|
Constructor Summary | |
SRP6Server()
|
Method Summary | |
java.math.BigInteger |
calculateSecret(java.math.BigInteger clientA)
Processes the client's credentials. |
java.math.BigInteger |
calculateServerEvidenceMessage()
Computes the server evidence message M2 using the previously verified values. |
java.math.BigInteger |
calculateSessionKey()
Computes the final session key as a result of the SRP successful mutual authentication To be called after calculating the server evidence message M2. |
java.math.BigInteger |
generateServerCredentials()
Generates the server's credentials that are to be sent to the client. |
void |
init(java.math.BigInteger N,
java.math.BigInteger g,
java.math.BigInteger v,
Digest digest,
java.security.SecureRandom random)
Initialises the server to accept a new client authentication attempt |
void |
init(SRP6GroupParameters group,
java.math.BigInteger v,
Digest digest,
java.security.SecureRandom random)
|
protected java.math.BigInteger |
selectPrivateValue()
|
boolean |
verifyClientEvidenceMessage(java.math.BigInteger clientM1)
Authenticates the received client evidence message M1 and saves it only if correct. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.math.BigInteger N
protected java.math.BigInteger g
protected java.math.BigInteger v
protected java.security.SecureRandom random
protected Digest digest
protected java.math.BigInteger A
protected java.math.BigInteger b
protected java.math.BigInteger B
protected java.math.BigInteger u
protected java.math.BigInteger S
protected java.math.BigInteger M1
protected java.math.BigInteger M2
protected java.math.BigInteger Key
Constructor Detail |
public SRP6Server()
Method Detail |
public void init(java.math.BigInteger N, java.math.BigInteger g, java.math.BigInteger v, Digest digest, java.security.SecureRandom random)
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 generationpublic void init(SRP6GroupParameters group, java.math.BigInteger v, Digest digest, java.security.SecureRandom random)
public java.math.BigInteger generateServerCredentials()
public java.math.BigInteger calculateSecret(java.math.BigInteger clientA) throws CryptoException
clientA
- The client's credentials
CryptoException
- If client's credentials are invalidprotected java.math.BigInteger selectPrivateValue()
public boolean verifyClientEvidenceMessage(java.math.BigInteger clientM1) throws CryptoException
clientM1
- the client side generated evidence message
CryptoException
public java.math.BigInteger calculateServerEvidenceMessage() throws CryptoException
CryptoException
public java.math.BigInteger calculateSessionKey() throws CryptoException
CryptoException
|
Bouncy Castle Cryptography Library 1.81 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |