use of org.jpos.util.SimpleMsg 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.SimpleMsg 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);
}
}
use of org.jpos.util.SimpleMsg in project jPOS by jpos.
the class BaseSMAdapter method generatePIN.
@Override
public EncryptedPIN generatePIN(String accountNumber, int pinLen, List<String> excludes) throws SMException {
List<Loggeable> cmdParameters = new ArrayList<Loggeable>();
cmdParameters.add(new SimpleMsg("parameter", "account number", accountNumber));
cmdParameters.add(new SimpleMsg("parameter", "PIN length", pinLen));
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", "Generate PIN", cmdParameters.toArray(new Loggeable[cmdParameters.size()])));
EncryptedPIN result = null;
try {
result = generatePINImpl(accountNumber, pinLen, excludes);
evt.addMessage(new SimpleMsg("result", "Generated 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.SimpleMsg in project jPOS by jpos.
the class BaseSMAdapter method generateKey.
@Override
public SecureDESKey generateKey(short keyLength, String keyType) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "Key Length", keyLength), new SimpleMsg("parameter", "Key Type", keyType) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Generate Key", cmdParameters));
SecureDESKey result = null;
try {
result = generateKeyImpl(keyLength, keyType);
evt.addMessage(new SimpleMsg("result", "Generated Key", 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.SimpleMsg in project jPOS by jpos.
the class BaseSMAdapter method importKey.
@Override
public SecureDESKey importKey(short keyLength, String keyType, byte[] encryptedKey, SecureDESKey kek, boolean checkParity) throws SMException {
SimpleMsg[] cmdParameters = { new SimpleMsg("parameter", "Key Length", keyLength), new SimpleMsg("parameter", "Key Type", keyType), new SimpleMsg("parameter", "Encrypted Key", encryptedKey), new SimpleMsg("parameter", "Key-Encrypting Key", kek), new SimpleMsg("parameter", "Check Parity", checkParity) };
LogEvent evt = new LogEvent(this, "s-m-operation");
evt.addMessage(new SimpleMsg("command", "Import Key", cmdParameters));
SecureDESKey result = null;
try {
result = importKeyImpl(keyLength, keyType, encryptedKey, kek, checkParity);
evt.addMessage(new SimpleMsg("result", "Imported Key", result));
} catch (Exception e) {
evt.addMessage(e);
throw e instanceof SMException ? (SMException) e : new SMException(e);
} finally {
Logger.log(evt);
}
return result;
}
Aggregations