use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseSMAdapter method translateKeyFromOldLMK.
@Override
public SecureDESKey translateKeyFromOldLMK(SecureDESKey kd) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "Key under old LMK", kd) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Translate Key from old to new LMK", cmdParameters));
SecureDESKey result = null;
try {
result = translateKeyFromOldLMKImpl(kd);
evt.addMessage(new SimpleMsg("result", "Translated Key under new LMK", result));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return result;
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseSMAdapter method decryptPIN.
@Override
public String decryptPIN(EncryptedPIN pinUnderLmk) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "PIN under LMK", pinUnderLmk) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Decrypt PIN", cmdParameters));
String result = null;
try {
result = decryptPINImpl(pinUnderLmk);
evt.addMessage(new SimpleMsg("result", "clear PIN", result));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return result;
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseSMAdapter method deriveIBMPIN.
@Override
public EncryptedPIN deriveIBMPIN(String accountNo, SecureDESKey pvk, String decTab, String pinValData, int minPinLen, String offset) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "account number", accountNo), new SimpleMsg("parameter", "Offset", offset), new SimpleMsg("parameter", "PVK", pvk), new SimpleMsg("parameter", "Decimalisation table", decTab), new SimpleMsg("parameter", "PIN validation data", pinValData), new SimpleMsg("parameter", "Minimum PIN length", minPinLen) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Derive a PIN Using the IBM Method", cmdParameters));
EncryptedPIN result = null;
try {
result = deriveIBMPINImpl(accountNo, pvk, decTab, pinValData, minPinLen, offset);
evt.addMessage(new SimpleMsg("result", "Derived PIN", result));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return result;
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseSMAdapter method calculateCAVV.
@Override
public String calculateCAVV(String accountNo, SecureDESKey cvk, String upn, String authrc, String sfarc) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo));
cmdParameters.add(new SimpleMsg("parameter", "cvk", cvk == null ? "" : cvk));
cmdParameters.add(new SimpleMsg("parameter", "unpredictable number", upn));
cmdParameters.add(new SimpleMsg("parameter", "auth rc", authrc));
cmdParameters.add(new SimpleMsg("parameter", "second factor auth rc", sfarc));
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Calculate CAVV/AAV", cmdParameters));
String result = null;
try {
result = calculateCAVVImpl(accountNo, cvk, upn, authrc, sfarc);
evt.addMessage(new SimpleMsg("result", "Calculated CAVV/AAV", result));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return result;
}
use of org.jpos.util.LogEvent in project jPOS by jpos.
the class BaseSMAdapter method generateARPC.
@Override
public byte[] generateARPC(MKDMethod mkdm, SKDMethod skdm, SecureDESKey imkac, String accoutNo, String acctSeqNo, byte[] arqc, byte[] atc, byte[] upn, ARPCMethod arpcMethod, byte[] arc, byte[] propAuthData) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "mkd method", mkdm), new SimpleMsg("parameter", "skd method", skdm), new SimpleMsg("parameter", "imk-ac", imkac), new SimpleMsg("parameter", "account number", accoutNo), new SimpleMsg("parameter", "accnt seq no", acctSeqNo), new SimpleMsg("parameter", "arqc", arqc == null ? "" : ISOUtil.hexString(arqc)), new SimpleMsg("parameter", "atc", atc == null ? "" : ISOUtil.hexString(atc)), new SimpleMsg("parameter", "upn", upn == null ? "" : ISOUtil.hexString(upn)), new SimpleMsg("parameter", "arpc gen. method", arpcMethod), new SimpleMsg("parameter", "auth. rc", arc == null ? "" : ISOUtil.hexString(arc)), new SimpleMsg("parameter", "prop auth. data", propAuthData == null ? "" : ISOUtil.hexString(propAuthData)) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Genarate ARPC", cmdParameters));
try {
byte[] result = generateARPCImpl(mkdm, skdm, imkac, accoutNo, acctSeqNo, arqc, atc, upn, arpcMethod, arc, propAuthData);
evt.addMessage(new SimpleMsg("result", "Generated ARPC", result));
return result;
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
}
Aggregations