jPOS 1.6.7 API Documentation

org.jpos.security
Class EncryptedPIN

java.lang.Object
  extended by org.jpos.security.EncryptedPIN
All Implemented Interfaces:
java.io.Serializable, Loggeable

public class EncryptedPIN
extends java.lang.Object
implements java.io.Serializable, Loggeable

The PIN (Personal Identification Number), is used to authenticate card holders. A user enters his/her PIN on the pin-pad (also called pin entry device) of a terminal (whether ATM or POS). The terminal forms the PIN Block, which is a mix of the PIN and the account number.
In a typical environment, the PIN Block (not the PIN) gets encrypted and sent to the acquirer. This Encrypted PIN Block is the typical content of the PIN Data ISO Field (Field 52). This class represents an encrypted PIN, no matter by whom it is encrypted. Typically a PIN is encrypted under one of these three:
1- Under a terminal PIN key (like TPK or DUKPT)
2- Under an Interchange PIN key (like ZPK)
3- Under the the security module itself (i.e. under LMK)
This class knows nothing about, who encrypted it.

This class represents an encrypted PIN using:
1- The PIN Block (encrypted)
2- The account number (the 12 right-most digits of the account number excluding the check digit)
3- The PIN Block Format

The PIN Block Format specifies how the clear pin (as entered by the card holder) and the account number get mixed to form the PIN Block.

Version:
$Revision: 2854 $ $Date: 2010-01-02 02:34:31 -0800 (Sat, 02 Jan 2010) $
Author:
Hani Samuel Kirollos
See Also:
SMAdapter, Serialized Form

Constructor Summary
EncryptedPIN()
           
EncryptedPIN(byte[] pinBlock, byte pinBlockFormat, java.lang.String accountNumber)
           
EncryptedPIN(java.lang.String pinBlockHexString, byte pinBlockFormat, java.lang.String accountNumber)
           
 
Method Summary
 void dump(java.io.PrintStream p, java.lang.String indent)
          dumps PIN basic information
static java.lang.String extractAccountNumberPart(java.lang.String accountNumber)
          This method extracts the 12 right-most digits of the account number, execluding the check digit.
 java.lang.String getAccountNumber()
           
 byte[] getPINBlock()
           
 byte getPINBlockFormat()
           
 void setAccountNumber(java.lang.String accountNumber)
          Sets the 12 right-most digits of the account number excluding the check digit
 void setPINBlock(byte[] pinBlock)
           
 void setPINBlockFormat(byte pinBlockFormat)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptedPIN

public EncryptedPIN()

EncryptedPIN

public EncryptedPIN(byte[] pinBlock,
                    byte pinBlockFormat,
                    java.lang.String accountNumber)
Parameters:
pinBlock -
pinBlockFormat -
accountNumber - (also functions correctly, if the complete account number with the check digit is passed)

EncryptedPIN

public EncryptedPIN(java.lang.String pinBlockHexString,
                    byte pinBlockFormat,
                    java.lang.String accountNumber)
Parameters:
pinBlockHexString - the PIN Block represented as a HexString instead of a byte[]
pinBlockFormat -
accountNumber - (also functions correctly, if the complete account number with the check digit is passed)
Method Detail

dump

public void dump(java.io.PrintStream p,
                 java.lang.String indent)
dumps PIN basic information

Specified by:
dump in interface Loggeable
Parameters:
p - a PrintStream usually supplied by Logger
indent - indention string, usually suppiled by Logger
See Also:
Loggeable

setPINBlock

public void setPINBlock(byte[] pinBlock)
Parameters:
pinBlock -

getPINBlock

public byte[] getPINBlock()
Returns:
pinBlock

setPINBlockFormat

public void setPINBlockFormat(byte pinBlockFormat)
Parameters:
pinBlockFormat -

getPINBlockFormat

public byte getPINBlockFormat()
Returns:
PIN Block Format

setAccountNumber

public void setAccountNumber(java.lang.String accountNumber)
Sets the 12 right-most digits of the account number excluding the check digit

Parameters:
accountNumber - (also functions correctly, if the complete account number with the check digit is passed)

getAccountNumber

public java.lang.String getAccountNumber()
Returns:
accountNumber (the 12 right-most digits of the account number excluding the check digit)

extractAccountNumberPart

public static java.lang.String extractAccountNumberPart(java.lang.String accountNumber)
This method extracts the 12 right-most digits of the account number, execluding the check digit.

Parameters:
accountNumber - (PAN) consists of the BIN (Bank Identification Number), accountNumber and a check digit.
Returns:
the 12 right-most digits of the account number, execluding the check digit.

jPOS.org