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);
}
}