|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.security.srp.SRPClientSession
public class SRPClientSession
The client side logic to the SRP protocol. The class is intended to be used with a SRPServerSession object via the SRPServerInterface. The SRP algorithm using these classes consists of: 1. Get server, SRPServerInterface server = (SRPServerInterface) Naming.lookup(...); 2. Get SRP parameters, SRPParameters params = server.getSRPParameters(username); 3. Create a client session, SRPClientSession client = new SRPClientSession(username, password, params); 4. Exchange public keys, byte[] A = client.exponential(); byte[] B = server.init(username, A); 5. Exchange challenges, byte[] M1 = client.response(B); byte[] M2 = server.verify(username, M1); 6. Verify the server response, if( client.verify(M2) == false ) throw new SecurityException("Failed to validate server reply"); 7. Validation complete Note that these steps are stateful. They must be performed in order and a step cannot be repeated to update the session state. This product uses the 'Secure Remote Password' cryptographic authentication system developed by Tom Wu (tjw@CS.Stanford.EDU).
Constructor Summary | |
---|---|
SRPClientSession(String username,
char[] password,
SRPParameters params)
Creates a new SRP server session object from the username, password verifier, |
|
SRPClientSession(String username,
char[] password,
SRPParameters params,
byte[] abytes)
Creates a new SRP server session object from the username, password verifier, |
Method Summary | |
---|---|
byte[] |
exponential()
|
byte[] |
getSessionKey()
Returns the negotiated session K, K = SHA_Interleave(S) |
byte[] |
response(byte[] Bbytes)
|
boolean |
verify(byte[] M2)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SRPClientSession(String username, char[] password, SRPParameters params)
username,
- the user IDpassword,
- the user clear text passwordparams,
- the SRP parameters for the sessionpublic SRPClientSession(String username, char[] password, SRPParameters params, byte[] abytes)
username,
- the user IDpassword,
- the user clear text passwordparams,
- the SRP parameters for the sessionabytes,
- the random exponent used in the A public key. This must be
8 bytes in length.Method Detail |
---|
public byte[] exponential()
public byte[] response(byte[] Bbytes) throws NoSuchAlgorithmException
NoSuchAlgorithmException
- thrown if the session key
MessageDigest algorithm cannot be found.public boolean verify(byte[] M2)
M2
- The server's response to the client's challengepublic byte[] getSessionKey() throws SecurityException
SecurityException
- - if the current thread does not have an
getSessionKey SRPPermission.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |