org.jboss.security.srp
Interface SRPServerInterface

All Known Subinterfaces:
SRPRemoteServerInterface (src)
All Known Implementing Classes:
SimpleSRPServer (src) , SRPRemoteServer (src)

public interface SRPServerInterface

An interface describing the message exchange of the SRP protocol as described in RFC2945. This is an RMI compatible interface in that all methods declare that they throw a RemoteException, but it does not extend from java.rmi.Remote so that it cannot be used in place of a Remote object. For an RMI interface see the SRPRemoteServerInterface. There are two versions of each method. One that takes an arbitrary session number and one that does not. The session number form allows a user to maintain mutiple SRP sessions.

See Also:
SRPRemoteServerInterface (src)

Method Summary
 void close(java.lang.String username)
          Close the SRP session for the given username.
 void close(java.lang.String username, int sessionID)
           
 SRPParameters (src) getSRPParameters(java.lang.String username)
          Get the SRP parameters to use for this session.
 java.lang.Object[] getSRPParameters(java.lang.String username, boolean mutipleSessions)
          Get the SRP parameters to use for this session and create an arbitrary session id to allow for multiple SRP sessions for this user.
 byte[] init(java.lang.String username, byte[] A)
          Initiate the SRP algorithm.
 byte[] init(java.lang.String username, byte[] A, int sessionID)
          Initiate the SRP algorithm.
 byte[] verify(java.lang.String username, byte[] M1)
          Verify the session key hash.
 byte[] verify(java.lang.String username, byte[] M1, int sessionID)
           
 byte[] verify(java.lang.String username, byte[] M1, java.lang.Object auxChallenge)
          Verify the session key hash.
 byte[] verify(java.lang.String username, byte[] M1, java.lang.Object auxChallenge, int sessionID)
           
 

Method Detail

getSRPParameters

public SRPParameters (src)  getSRPParameters(java.lang.String username)
                               throws java.security.KeyException,
                                      java.rmi.RemoteException
Get the SRP parameters to use for this session.

Returns:
the users SRPParameters object
Throws:
java.security.KeyException
java.rmi.RemoteException

getSRPParameters

public java.lang.Object[] getSRPParameters(java.lang.String username,
                                           boolean mutipleSessions)
                                    throws java.security.KeyException,
                                           java.rmi.RemoteException
Get the SRP parameters to use for this session and create an arbitrary session id to allow for multiple SRP sessions for this user.

Returns:
an array of {SRPParameters, Integer} where element[0] is the SRPParameters object and element[1] is the session id as an Integer.
Throws:
java.security.KeyException
java.rmi.RemoteException

init

public byte[] init(java.lang.String username,
                   byte[] A)
            throws java.lang.SecurityException,
                   java.security.NoSuchAlgorithmException,
                   java.rmi.RemoteException
Initiate the SRP algorithm. The client sends their username and the public key A to begin the SRP handshake.

Returns:
byte[], ephemeral server public key B = (v + g ^ b) % N
Throws:
KeyException, - thrown if the username is not known by the server.
RemoteException, - thrown by remote implementations
java.lang.SecurityException
java.security.NoSuchAlgorithmException
java.rmi.RemoteException

init

public byte[] init(java.lang.String username,
                   byte[] A,
                   int sessionID)
            throws java.lang.SecurityException,
                   java.security.NoSuchAlgorithmException,
                   java.rmi.RemoteException
Initiate the SRP algorithm. The client sends their username and the public key A to begin the SRP handshake.

Returns:
byte[], ephemeral server public key B = (v + g ^ b) % N
Throws:
KeyException, - thrown if the username is not known by the server.
RemoteException, - thrown by remote implementations
java.lang.SecurityException
java.security.NoSuchAlgorithmException
java.rmi.RemoteException

verify

public byte[] verify(java.lang.String username,
                     byte[] M1)
              throws java.lang.SecurityException,
                     java.rmi.RemoteException
Verify the session key hash. The client sends their username and M1 hash to validate completion of the SRP handshake.

Returns:
M2, the server hash of the client challenge; M2 = H(A | M1 | K)
Throws:
SecurityException, - thrown if M1 cannot be verified by the server
RemoteException, - thrown by remote implementations
java.lang.SecurityException
java.rmi.RemoteException

verify

public byte[] verify(java.lang.String username,
                     byte[] M1,
                     int sessionID)
              throws java.lang.SecurityException,
                     java.rmi.RemoteException
Throws:
java.lang.SecurityException
java.rmi.RemoteException

verify

public byte[] verify(java.lang.String username,
                     byte[] M1,
                     java.lang.Object auxChallenge)
              throws java.lang.SecurityException,
                     java.rmi.RemoteException
Verify the session key hash. The client sends their username and M1 hash to validate completion of the SRP handshake.

Returns:
M2, the server hash of the client challenge; M2 = H(A | M1 | K)
Throws:
SecurityException, - thrown if M1 cannot be verified by the server
RemoteException, - thrown by remote implementations
java.lang.SecurityException
java.rmi.RemoteException

verify

public byte[] verify(java.lang.String username,
                     byte[] M1,
                     java.lang.Object auxChallenge,
                     int sessionID)
              throws java.lang.SecurityException,
                     java.rmi.RemoteException
Throws:
java.lang.SecurityException
java.rmi.RemoteException

close

public void close(java.lang.String username)
           throws java.lang.SecurityException,
                  java.rmi.RemoteException
Close the SRP session for the given username.

Throws:
java.lang.SecurityException
java.rmi.RemoteException

close

public void close(java.lang.String username,
                  int sessionID)
           throws java.lang.SecurityException,
                  java.rmi.RemoteException
Throws:
java.lang.SecurityException
java.rmi.RemoteException