com.ibm.atp.auth
Class Auth

java.lang.Object
  |
  +--com.ibm.atp.auth.Auth
Direct Known Subclasses:
AuthByDigest, AuthBySignature

public abstract class Auth
extends java.lang.Object

The Auth class is the class for challenge-response authentication.

Version:
1.00 $Date: 2001/07/28 06:33:42 $
Author:
ONO Kouichi

Field Summary
static int FIRST_TURN
          The turn of protocol : first turn.
static int NO_TURNS
          The turn of protocol : No turns.
static int SECOND_TURN
          The turn of protocol : second turn.
 
Constructor Summary
protected Auth()
          Default constructor creates a default message digest function.
protected Auth(java.lang.String name)
          Constructor creates a specified message digest function.
 
Method Summary
protected  void addBytes(byte[] bytes)
          Adds byte sequence into digest function.
abstract  byte[] calculateResponse(int turn, Challenge challenge)
          Calculate response value for authentication.
 java.lang.String getDigestAlgorithm()
          Returns the name of message digest function algorithm.
protected  byte[] getDigestValue()
          Returns digest value by digest function.
 java.lang.String getFirstTurnIdentifier()
          Gets the identifier of first turn individual.
 java.lang.String getSecondTurnIdentifier()
          Gets the identifier of second turn individual.
protected  java.lang.String getTurnPad(int turn)
          Returns the pad of turn individual.
protected abstract  byte[] hash(int turn, Challenge challenge)
          Returns hased value by digest function for the turn player.
protected  void resetDigest()
          Resets message digest function.
protected  void setDigestAlgorithm(java.lang.String name)
          Sets the name of message digest function algorithm.
 void setFirstTurnIdentifier(java.lang.String id)
          Sets the identifier of first turn individual.
 void setSecondTurnIdentifier(java.lang.String id)
          Sets the identifier of second turn individual.
abstract  boolean verify(int turn, Challenge challenge, byte[] response)
          Verify response value for authentication.
abstract  boolean verify(int turn, Challenge challenge, ByteSequence response)
          Verify response value for authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_TURNS

public static final int NO_TURNS
The turn of protocol : No turns.

FIRST_TURN

public static final int FIRST_TURN
The turn of protocol : first turn.

SECOND_TURN

public static final int SECOND_TURN
The turn of protocol : second turn.
Constructor Detail

Auth

protected Auth()
Default constructor creates a default message digest function.

Auth

protected Auth(java.lang.String name)
Constructor creates a specified message digest function.
Parameters:
name - the name of message digest function algorithm
Method Detail

addBytes

protected void addBytes(byte[] bytes)
Adds byte sequence into digest function.
Parameters:
bytes - byte sequence to be added

calculateResponse

public abstract byte[] calculateResponse(int turn,
                                         Challenge challenge)
                                  throws AuthenticationException
Calculate response value for authentication.
Parameters:
turn - of individual
challenge - a challenge
Returns:
response value for authentication
Throws:
AuthenticationException - byte sequence for response is invalid

getDigestAlgorithm

public java.lang.String getDigestAlgorithm()
Returns the name of message digest function algorithm.
Returns:
the name of message digest function algorithm.

getDigestValue

protected byte[] getDigestValue()
Returns digest value by digest function.
Returns:
digest value by digest function

getFirstTurnIdentifier

public java.lang.String getFirstTurnIdentifier()
Gets the identifier of first turn individual.
Returns:
identifier of first turn individual

getSecondTurnIdentifier

public java.lang.String getSecondTurnIdentifier()
Gets the identifier of second turn individual.
Returns:
identifier of second turn individual

getTurnPad

protected java.lang.String getTurnPad(int turn)
Returns the pad of turn individual.
Parameters:
turn - turn of infividual
Returns:
pad of turn individual

hash

protected abstract byte[] hash(int turn,
                               Challenge challenge)
                        throws AuthenticationException
Returns hased value by digest function for the turn player.
Parameters:
turn - turn of infividual
challenge - a challenge
Returns:
hased value by digest function for the turn player
Throws:
AuthenticationException - byte sequence to be hased is invalid

resetDigest

protected void resetDigest()
Resets message digest function.

setDigestAlgorithm

protected void setDigestAlgorithm(java.lang.String name)
Sets the name of message digest function algorithm.
Parameters:
name - the name of message digest function algorithm

setFirstTurnIdentifier

public void setFirstTurnIdentifier(java.lang.String id)
Sets the identifier of first turn individual.
Parameters:
id - identifier of first turn individual

setSecondTurnIdentifier

public void setSecondTurnIdentifier(java.lang.String id)
Sets the identifier of second turn individual.
Parameters:
id - identifier of second turn individual

verify

public abstract boolean verify(int turn,
                               Challenge challenge,
                               byte[] response)
                        throws AuthenticationException
Verify response value for authentication.
Parameters:
turn - of individual
challenge - a challenge
response - response value for authentication
Throws:
AuthenticationException - byte sequence for response is invalid

verify

public abstract boolean verify(int turn,
                               Challenge challenge,
                               ByteSequence response)
                        throws AuthenticationException
Verify response value for authentication.
Parameters:
turn - of individual
challenge - a challenge
response - response value for authentication
Throws:
AuthenticationException - byte sequence for response is invalid