|
jPOS 1.6.1 API Documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jpos.security.BaseSMAdapter
public class BaseSMAdapter
Provides base functionality for the actual Security Module Adapter.
You adapter needs to override the methods that end with "Impl"
| Field Summary |
|---|
| Fields inherited from interface org.jpos.security.SMAdapter |
|---|
FORMAT00, FORMAT01, FORMAT02, FORMAT03, FORMAT04, FORMAT05, LENGTH_DES, LENGTH_DES3_2KEY, LENGTH_DES3_3KEY, TYPE_BDK, TYPE_CVK, TYPE_PVK, TYPE_TAK, TYPE_TMK, TYPE_TPK, TYPE_ZAK, TYPE_ZMK, TYPE_ZPK |
| Constructor Summary | |
|---|---|
BaseSMAdapter()
|
|
BaseSMAdapter(Configuration cfg,
Logger logger,
java.lang.String realm)
|
|
| Method Summary | |
|---|---|
java.lang.String |
decryptPIN(EncryptedPIN pinUnderLmk)
Decrypts an Encrypted PIN (under LMK). |
EncryptedPIN |
encryptPIN(java.lang.String pin,
java.lang.String accountNumber)
Encrypts a clear pin under LMK. |
byte[] |
exportKey(SecureDESKey key,
SecureDESKey kek)
Exports secure key to encryption under a KEK (Key-Encrypting Key). |
EncryptedPIN |
exportPIN(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Exports a PIN from encryption under LMK to encryption under a KD (Data Key). |
byte[] |
generateCBC_MAC(byte[] data,
SecureDESKey kd)
Generates CBC-MAC (Cipher Block Chaining Message Authentication Code) for some data. |
SecureDESKey |
generateKey(short keyLength,
java.lang.String keyType)
Generates a random DES Key. |
Logger |
getLogger()
|
java.lang.String |
getName()
|
java.lang.String |
getRealm()
|
static SMAdapter |
getSMAdapter(java.lang.String name)
|
SecureDESKey |
importKey(short keyLength,
java.lang.String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
Imports a key from encryption under a KEK (Key-Encrypting Key) to protection under the security module. |
EncryptedPIN |
importPIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk)
Imports a PIN from encryption under a transaction key to encryption under LMK. |
EncryptedPIN |
importPIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
Imports a PIN from encryption under KD (Data Key) to encryption under LMK. |
void |
setConfiguration(Configuration cfg)
|
void |
setLogger(Logger logger,
java.lang.String realm)
|
void |
setName(java.lang.String name)
associates this SMAdapter with a name using NameRegistrar |
EncryptedPIN |
translatePIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Translates a PIN from encryption under a transaction key to encryption under a KD (Data Key). |
EncryptedPIN |
translatePIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Translates a PIN from encrytion under KD1 to encryption under KD2. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseSMAdapter()
public BaseSMAdapter(Configuration cfg,
Logger logger,
java.lang.String realm)
throws ConfigurationException
ConfigurationException| Method Detail |
|---|
public void setConfiguration(Configuration cfg)
throws ConfigurationException
setConfiguration in interface Configurablecfg - Configuration object
ConfigurationException
public void setLogger(Logger logger,
java.lang.String realm)
setLogger in interface LogSourcepublic Logger getLogger()
getLogger in interface LogSourcepublic java.lang.String getRealm()
getRealm in interface LogSourcepublic void setName(java.lang.String name)
name - name to registerNameRegistrarpublic java.lang.String getName()
public static SMAdapter getSMAdapter(java.lang.String name)
throws NameRegistrar.NotFoundException
name -
NameRegistrar.NotFoundExceptionNameRegistrar
public SecureDESKey generateKey(short keyLength,
java.lang.String keyType)
throws SMException
SMAdapter
generateKey in interface SMAdapterkeyLength - bit length of the key to be generated (LENGTH_DES, LENGTH_DES3_2KEY...)keyType - type of the key to be generated (TYPE_ZMK, TYPE_TMK...etc)
SMException
public SecureDESKey importKey(short keyLength,
java.lang.String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
throws SMException
SMAdapter
importKey in interface SMAdapterkeyLength - bit length of the key to be imported (LENGTH_DES, LENGTH_DES3_2KEY...etc)keyType - type of the key to be imported (TYPE_ZMK, TYPE_TMK...etc)encryptedKey - key to be imported encrypted under KEKkek - the key-encrypting keycheckParity - if true, the key is not imported unless it has adjusted parity
SMException - if the parity of the imported key is not adjusted AND checkParity = true
public byte[] exportKey(SecureDESKey key,
SecureDESKey kek)
throws SMException
SMAdapter
exportKey in interface SMAdapterkey - the secure key to be exportedkek - the key-encrypting key
SMException
public EncryptedPIN encryptPIN(java.lang.String pin,
java.lang.String accountNumber)
throws SMException
SMAdapter
encryptPIN in interface SMAdapterpin - clear pin as entered by card holderaccountNumber - The 12 right-most digits of the account number excluding the check digit. Should also function correctly if the complete account number, including the check digit is passed.
SMException
public java.lang.String decryptPIN(EncryptedPIN pinUnderLmk)
throws SMException
SMAdapter
decryptPIN in interface SMAdapterSMException
public EncryptedPIN importPIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
throws SMException
SMAdapter
importPIN in interface SMAdapterpinUnderKd1 - the encrypted PINkd1 - Data Key under which the pin is encrypted
SMException
public EncryptedPIN translatePIN(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
SMAdapter
translatePIN in interface SMAdapterpinUnderKd1 - pin encrypted under KD1kd1 - Data Key (also called session key) under which the pin is encryptedkd2 - the destination Data Key 2 under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the exported encrypted PIN
SMException
public EncryptedPIN importPIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk)
throws SMException
SMAdapter
importPIN in interface SMAdapterpinUnderDuk - pin encrypted under a transaction keyksn - Key Serial Number (also called Key Name, in ANSI X9.24) needed to derive the transaction keybdk - Base Derivation Key, used to derive the transaction key underwhich the pin is encrypted
SMException
public EncryptedPIN translatePIN(EncryptedPIN pinUnderDuk,
KeySerialNumber ksn,
SecureDESKey bdk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
SMAdapter
translatePIN in interface SMAdapterpinUnderDuk - pin encrypted under a DUKPT transaction keyksn - Key Serial Number (also called Key Name, in ANSI X9.24) needed to derive the transaction keybdk - Base Derivation Key, used to derive the transaction key underwhich the pin is encryptedkd2 - the destination Data Key (also called session key) under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the translated encrypted PIN
SMException
public EncryptedPIN exportPIN(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
SMAdapter
exportPIN in interface SMAdapterpinUnderLmk - pin encrypted under LMKkd2 - the destination data key (also called session key) under which the pin will be encrypteddestinationPINBlockFormat - the PIN Block Format of the exported encrypted PIN
SMException
public byte[] generateCBC_MAC(byte[] data,
SecureDESKey kd)
throws SMException
SMAdapter
generateCBC_MAC in interface SMAdapterdata - the data to be MACedkd - the key used for MACing
SMException
|
jPOS.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||