edu.psu.its.twofactor
Class ncPassProtocol

java.lang.Object
  extended by edu.psu.its.twofactor.ncPassProtocol

public class ncPassProtocol
extends java.lang.Object

Methods for building and parsing messages sent to and received from the NCPASS TLI interface for the purpose of validating RSA SecureID tokens.


Constructor Summary
ncPassProtocol()
          Sole Constructor, generates a six digit random transaction ID and stores it in a String
 
Method Summary
 byte[] buildHandShake(java.lang.String appID)
          Builds the NCPASS TLI handshake.
 byte[] buildRequest(java.lang.String userID, java.lang.String secureID)
          Builds the NCPASS TLI query for authenticating an RSA SecureID token / UserID pair.
 java.util.Hashtable decodeHandshake(byte[] handshake)
          Decodes the NCPASS TLI handshake response and returns a hashtable containing all of the returned data fields.
 java.util.Hashtable decodeResponse(byte[] response)
          Decodes the NCPASS query response and returns a hashtable containing all of the returned data fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ncPassProtocol

public ncPassProtocol()
               throws java.io.UnsupportedEncodingException
Sole Constructor, generates a six digit random transaction ID and stores it in a String

Throws:
java.io.UnsupportedEncodingException
Method Detail

buildHandShake

public byte[] buildHandShake(java.lang.String appID)
                      throws java.io.UnsupportedEncodingException,
                             java.io.IOException
Builds the NCPASS TLI handshake. This handshake is sent to the NCPASS server to initiate the SecureID token check

Parameters:
String - appID
Returns:
byte[] array containing the handshake initiator to be sent to NCPASS
Throws:
java.io.UnsupportedEncodingException
java.io.IOException

decodeHandshake

public java.util.Hashtable decodeHandshake(byte[] handshake)
                                    throws java.io.UnsupportedEncodingException
Decodes the NCPASS TLI handshake response and returns a hashtable containing all of the returned data fields.

Parameters:
byte[] - handshake - byte array containing handshake response from NCPASS
Returns:
Hashtable containing decoded parameters from NCPASS response
Throws:
java.io.UnsupportedEncodingException

decodeResponse

public java.util.Hashtable decodeResponse(byte[] response)
                                   throws java.io.UnsupportedEncodingException
Decodes the NCPASS query response and returns a hashtable containing all of the returned data fields. Also contains text explinations of the Validation and AuthenticationResult codes

Parameters:
byte[]response - - byte array containing NCPASS query response
Returns:
Hashtable containing decoded parameters from NCPASS response
Throws:
java.io.UnsupportedEncodingException

buildRequest

public byte[] buildRequest(java.lang.String userID,
                           java.lang.String secureID)
                    throws java.io.UnsupportedEncodingException,
                           java.io.IOException
Builds the NCPASS TLI query for authenticating an RSA SecureID token / UserID pair. While this data is sent in the clear (NCPASS does not support SSL) the userid and SecureID number are not subject to a replay attack as once a number is validated it cannot be used again until the token cycles the number.

Parameters:
String - userID containing the user's principal name
String - secureID containing the SecureID number
Returns:
byte[] array containing the query to be sent to NCPASS
Throws:
java.io.UnsupportedEncodingException
java.io.IOException