use of org.jpos.util.Loggeable in project jPOS by jpos.
the class BaseSMAdapter method calculatePVV.
@Override
public String calculatePVV(EncryptedPIN pinUnderKd1, SecureDESKey kd1, SecureDESKey pvkA, SecureDESKey pvkB, int pvkIdx, List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
cmdParameters.add(new SimpleMsg("parameter", "account number", pinUnderKd1.getAccountNumber()));
cmdParameters.add(new SimpleMsg("parameter", "PIN under Data Key 1", pinUnderKd1));
cmdParameters.add(new SimpleMsg("parameter", "Data Key 1", kd1));
cmdParameters.add(new SimpleMsg("parameter", "PVK-A", pvkA == null ? "" : pvkA));
cmdParameters.add(new SimpleMsg("parameter", "PVK-B", pvkB == null ? "" : pvkB));
cmdParameters.add(new SimpleMsg("parameter", "PVK index", pvkIdx));
if (excludes != null && !excludes.isEmpty())
cmdParameters.add(new SimpleMsg("parameter", "Excluded PINs list", excludes));
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Calculate PVV", cmdParameters.toArray(new Loggeable[cmdParameters.size()])));
String result = null;
try {
result = calculatePVVImpl(pinUnderKd1, kd1, pvkA, pvkB, pvkIdx, excludes);
evt.addMessage(new SimpleMsg("result", "Calculated PVV", 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.Loggeable 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.Loggeable in project jPOS by jpos.
the class BaseSMAdapter method verifyCAVV.
@Override
public boolean verifyCAVV(String accountNo, SecureDESKey cvk, String cavv, 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", "cavv", cavv == null ? "" : cavv));
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", "Verify CAVV/AAV", cmdParameters));
boolean r = false;
try {
r = verifyCAVVImpl(accountNo, cvk, cavv, upn, authrc, sfarc);
evt.addMessage(new SimpleMsg("result", "Verification status", r));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return r;
}
use of org.jpos.util.Loggeable in project jPOS by jpos.
the class BaseSMAdapter method translatePINGenerateSM_MAC.
@Override
public Pair<EncryptedPIN, byte[]> translatePINGenerateSM_MAC(MKDMethod mkdm, SKDMethod skdm, PaddingMethod padm, SecureDESKey imksmi, String accountNo, String acctSeqNo, byte[] atc, byte[] arqc, byte[] data, EncryptedPIN currentPIN, EncryptedPIN newPIN, SecureDESKey kd1, SecureDESKey imksmc, SecureDESKey imkac, byte destinationPINBlockFormat) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
cmdParameters.add(new SimpleMsg("parameter", "mkd method", mkdm));
cmdParameters.add(new SimpleMsg("parameter", "skd method", skdm));
if (padm != null)
cmdParameters.add(new SimpleMsg("parameter", "padding method", padm));
cmdParameters.add(new SimpleMsg("parameter", "imk-smi", imksmi));
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNo));
cmdParameters.add(new SimpleMsg("parameter", "accnt seq no", acctSeqNo));
cmdParameters.add(new SimpleMsg("parameter", "atc", atc == null ? "" : ISOUtil.hexString(atc)));
cmdParameters.add(new SimpleMsg("parameter", "arqc", arqc == null ? "" : ISOUtil.hexString(arqc)));
cmdParameters.add(new SimpleMsg("parameter", "data", data == null ? "" : ISOUtil.hexString(data)));
cmdParameters.add(new SimpleMsg("parameter", "Current Encrypted PIN", currentPIN));
cmdParameters.add(new SimpleMsg("parameter", "New Encrypted PIN", newPIN));
cmdParameters.add(new SimpleMsg("parameter", "Source PIN Encryption Key", kd1));
cmdParameters.add(new SimpleMsg("parameter", "imk-smc", imksmc));
if (imkac != null)
cmdParameters.add(new SimpleMsg("parameter", "imk-ac", imkac));
cmdParameters.add(new SimpleMsg("parameter", "Destination PIN Block Format", destinationPINBlockFormat));
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Translate PIN block format and Generate Secure Messaging MAC", cmdParameters.toArray(new Loggeable[cmdParameters.size()])));
try {
Pair<EncryptedPIN, byte[]> r = translatePINGenerateSM_MACImpl(mkdm, skdm, padm, imksmi, accountNo, acctSeqNo, atc, arqc, data, currentPIN, newPIN, kd1, imksmc, imkac, destinationPINBlockFormat);
SimpleMsg[] cmdResults = { new SimpleMsg("result", "Translated PIN block", r.getValue0()), new SimpleMsg("result", "Generated MAC", r.getValue1() == null ? "" : ISOUtil.hexString(r.getValue1())) };
evt.addMessage(new SimpleMsg("results", "Complex results", cmdResults));
return r;
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
}
use of org.jpos.util.Loggeable in project jPOS by jpos.
the class BaseSMAdapter method translateKeyFromOldLMK.
@Override
public SecureDESKey translateKeyFromOldLMK(SecureDESKey kd) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<>();
cmdParameters.add(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;
}
Aggregations