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