Coalevo Logo

net.coalevo.foundation.util.srp
Class ClientSRP

java.lang.Object
  extended by net.coalevo.foundation.util.srp.ClientSRP

public class ClientSRP
extends java.lang.Object

Provides an SRP helper for SRP client side.

Version:
1.0.0 (10/02/2009)
Author:
Dieter Wimberger (coalevo)

Constructor Summary
ClientSRP(java.lang.String username, java.lang.String password)
           
 
Method Summary
 boolean checkServerKeyProof(java.lang.String proof)
          Tests the server key proof.
 java.lang.String getKeyMatchProof()
          Return the client key match proof.
 java.lang.String getPublicEphemeral()
          Returns the public client ephemeral value.
 byte[] getSessionKey()
          Returns the raw session key.
 java.lang.String getUsername()
          Returns the username.
 boolean received(java.lang.String salt, java.lang.String Bhex)
          Should be called when the server returned the session init.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSRP

public ClientSRP(java.lang.String username,
                 java.lang.String password)
Method Detail

getUsername

public java.lang.String getUsername()
Returns the username.

Returns:
the username.

getPublicEphemeral

public java.lang.String getPublicEphemeral()
Returns the public client ephemeral value.

Returns:
a String of hex encoded bytes representing a BigInteger value.

received

public boolean received(java.lang.String salt,
                        java.lang.String Bhex)
Should be called when the server returned the session init.

Parameters:
salt - the users salt.
Bhex - the server public ephemeral as hex encoded BigInteger value.
Returns:
false if aborted due to safeguards or key generation errors.

getKeyMatchProof

public java.lang.String getKeyMatchProof()
Return the client key match proof.

Returns:
a client key match proof.

checkServerKeyProof

public boolean checkServerKeyProof(java.lang.String proof)
Tests the server key proof.

Parameters:
proof - the proof received from the server.
Returns:
true if ok, false otherwise.

getSessionKey

public byte[] getSessionKey()
Returns the raw session key.

Returns:
the session key as raw byte[].

Coalevo Logo

(c) 2004-2009 VFI (http://www.vfi.or.at)