|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpos.security.BaseSMAdapter
org.jpos.security.jceadapter.JCESecurityModule
public class JCESecurityModule
JCESecurityModule is an implementation of a security module in software.
It doesn't require any hardware device to work.
JCESecurityModule also implements the SMAdapter, so you can view it: either
as a self contained security module adapter that doesn't need a security module
or a security module that plugs directly to jpos, so doesn't need
a separate adapter.
It relies on Java(tm) Cryptography Extension (JCE), hence its name.
JCESecurityModule relies on the JCEHandler class to do the low level JCE work.
WARNING: This version of JCESecurityModule is meant for testing purposes and NOT for life operation, since the Local Master Keys are stored in CLEAR on the system's disk. Comming versions of JCESecurity Module will rely on java.security.KeyStore for a better protection of the Local Master Keys.
| Field Summary |
|---|
| Fields inherited from class org.jpos.security.BaseSMAdapter |
|---|
cfg, logger, realm |
| Fields inherited from interface org.jpos.security.SMAdapter |
|---|
FORMAT00, FORMAT01, FORMAT02, FORMAT03, FORMAT04, FORMAT05, FORMAT34, FORMAT35, FORMAT41, FORMAT42, LENGTH_DES, LENGTH_DES3_2KEY, LENGTH_DES3_3KEY, TYPE_BDK, TYPE_CVK, TYPE_MK_AC, TYPE_MK_CVC3, TYPE_MK_SMC, TYPE_MK_SMI, TYPE_PVK, TYPE_TAK, TYPE_TMK, TYPE_TPK, TYPE_ZAK, TYPE_ZMK, TYPE_ZPK |
| Constructor Summary | |
|---|---|
JCESecurityModule()
Creates an uninitialized JCE Security Module, you need to setConfiguration to initialize it |
|
JCESecurityModule(Configuration cfg,
Logger logger,
String realm)
|
|
JCESecurityModule(String lmkFile)
|
|
JCESecurityModule(String lmkFile,
String jceProviderClassName)
|
|
| Method Summary | |
|---|---|
protected String |
calculateCVVImpl(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
Date expDate,
String serviceCode)
Your SMAdapter should override this method if it has this functionality |
protected String |
calculatePVVImpl(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
Your SMAdapter should override this method if it has this functionality |
String |
decryptPINImpl(EncryptedPIN pinUnderLmk)
Your SMAdapter should override this method if it has this functionality |
EncryptedPIN |
encryptPINImpl(String pin,
String accountNumber)
Your SMAdapter should override this method if it has this functionality |
byte[] |
exportKeyImpl(SecureDESKey key,
SecureDESKey kek)
Your SMAdapter should override this method if it has this functionality |
EncryptedPIN |
exportPINImpl(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Your SMAdapter should override this method if it has this functionality |
protected byte[] |
generateCBC_MACImpl(byte[] data,
SecureDESKey kd)
Generates CBC-MAC (Cipher Block Chaining Message Authentication Code) for some data. |
protected byte[] |
generateEDE_MACImpl(byte[] data,
SecureDESKey kd)
Generates EDE-MAC (Encrypt Decrypt Encrypt Message Authentication Code) for some data. |
protected byte[] |
generateKeyCheckValueImpl(SecureDESKey secureDESKey)
Generates key check value. |
SecureDESKey |
generateKeyImpl(short keyLength,
String keyType)
Your SMAdapter should override this method if it has this functionality |
EncryptedPIN |
generatePINImpl(String accountNumber,
int pinLen,
List<String> excludes)
Your SMAdapter should override this method if it has this functionality |
SecureDESKey |
importKeyImpl(short keyLength,
String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
Your SMAdapter should override this method if it has this functionality |
EncryptedPIN |
importPINImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
Your SMAdapter should override this method if it has this functionality |
void |
setConfiguration(Configuration cfg)
Configures a JCESecurityModule |
EncryptedPIN |
translatePINImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
Your SMAdapter should override this method if it has this functionality |
protected boolean |
verifyCVC3Impl(SecureDESKey imkcvc3,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] upn,
byte[] data,
MKDMethod mkdm,
String cvc3)
Your SMAdapter should override this method if it has this functionality |
protected boolean |
verifyCVVImpl(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
String cvv,
Date expDate,
String serviceCode)
Your SMAdapter should override this method if it has this functionality |
protected boolean |
verifydCVVImpl(String accountNo,
SecureDESKey imkac,
String dcvv,
Date expDate,
String serviceCode,
byte[] atc,
MKDMethod mkdm)
Your SMAdapter should override this method if it has this functionality |
boolean |
verifyPVVImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvki,
String pvv)
Your SMAdapter should override this method if it has this functionality |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JCESecurityModule()
public JCESecurityModule(String lmkFile)
throws SMException
lmkFile - Local Master Keys filename of the JCE Security Module
SMException
public JCESecurityModule(String lmkFile,
String jceProviderClassName)
throws SMException
SMException
public JCESecurityModule(Configuration cfg,
Logger logger,
String realm)
throws ConfigurationException
ConfigurationException| Method Detail |
|---|
public void setConfiguration(Configuration cfg)
throws ConfigurationException
setConfiguration in interface ConfigurablesetConfiguration in class BaseSMAdaptercfg - The following properties are read:ConfigurationException
public SecureDESKey generateKeyImpl(short keyLength,
String keyType)
throws SMException
BaseSMAdapter
generateKeyImpl in class BaseSMAdapterSMException
public SecureDESKey importKeyImpl(short keyLength,
String keyType,
byte[] encryptedKey,
SecureDESKey kek,
boolean checkParity)
throws SMException
BaseSMAdapter
importKeyImpl in class BaseSMAdapterSMException
public byte[] exportKeyImpl(SecureDESKey key,
SecureDESKey kek)
throws SMException
BaseSMAdapter
exportKeyImpl in class BaseSMAdapterSMException
public EncryptedPIN encryptPINImpl(String pin,
String accountNumber)
throws SMException
BaseSMAdapter
encryptPINImpl in class BaseSMAdapterSMException
public String decryptPINImpl(EncryptedPIN pinUnderLmk)
throws SMException
BaseSMAdapter
decryptPINImpl in class BaseSMAdapterSMException
public EncryptedPIN importPINImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1)
throws SMException
BaseSMAdapter
importPINImpl in class BaseSMAdapterSMException
public EncryptedPIN exportPINImpl(EncryptedPIN pinUnderLmk,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
BaseSMAdapter
exportPINImpl in class BaseSMAdapterSMException
public EncryptedPIN generatePINImpl(String accountNumber,
int pinLen,
List<String> excludes)
throws SMException
BaseSMAdapter
generatePINImpl in class BaseSMAdapterSMException
protected String calculateCVVImpl(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
Date expDate,
String serviceCode)
throws SMException
BaseSMAdapter
calculateCVVImpl in class BaseSMAdapterSMException
protected boolean verifyCVVImpl(String accountNo,
SecureDESKey cvkA,
SecureDESKey cvkB,
String cvv,
Date expDate,
String serviceCode)
throws SMException
BaseSMAdapter
verifyCVVImpl in class BaseSMAdapterSMException
protected boolean verifydCVVImpl(String accountNo,
SecureDESKey imkac,
String dcvv,
Date expDate,
String serviceCode,
byte[] atc,
MKDMethod mkdm)
throws SMException
BaseSMAdapter
verifydCVVImpl in class BaseSMAdapterSMException
protected boolean verifyCVC3Impl(SecureDESKey imkcvc3,
String accountNo,
String acctSeqNo,
byte[] atc,
byte[] upn,
byte[] data,
MKDMethod mkdm,
String cvc3)
throws SMException
BaseSMAdapter
verifyCVC3Impl in class BaseSMAdapterSMException
protected String calculatePVVImpl(EncryptedPIN pinUnderLmk,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvkIdx,
List<String> excludes)
throws SMException
BaseSMAdapter
calculatePVVImpl in class BaseSMAdapterSMException
public boolean verifyPVVImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey pvkA,
SecureDESKey pvkB,
int pvki,
String pvv)
throws SMException
BaseSMAdapter
verifyPVVImpl in class BaseSMAdapterSMException
public EncryptedPIN translatePINImpl(EncryptedPIN pinUnderKd1,
SecureDESKey kd1,
SecureDESKey kd2,
byte destinationPINBlockFormat)
throws SMException
BaseSMAdapter
translatePINImpl in class BaseSMAdapterSMException
protected byte[] generateCBC_MACImpl(byte[] data,
SecureDESKey kd)
throws SMException
generateCBC_MACImpl in class BaseSMAdapterdata - the data to be MACedkd - the key used for MACing
SMException
protected byte[] generateEDE_MACImpl(byte[] data,
SecureDESKey kd)
throws SMException
generateEDE_MACImpl in class BaseSMAdapterdata - the data to be MACedkd - the key used for MACing
SMException
protected byte[] generateKeyCheckValueImpl(SecureDESKey secureDESKey)
throws SMException
generateKeyCheckValueImpl in class BaseSMAdaptersecureDESKey - SecureDESKey with untrusted or fake Key Check Value
SMException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||