short keyLength = (short)Integer.parseInt(commandParams[0]);
if (commandName.toUpperCase().compareTo("GC") == 0) {
String clearKeyComponenetHexString = sm.generateClearKeyComponent(keyLength);
}
else if (commandName.toUpperCase().compareTo("FK") == 0) {
SecureDESKey KEYunderLMK = sm.formKEYfromThreeClearComponents(keyLength,
commandParams[1].toUpperCase(), commandParams[2], commandParams[3], commandParams[4]);
}
else if (commandName.toUpperCase().compareTo("CK") == 0) {
byte[] keyCheckValue = sm.generateKeyCheckValue(
new SecureDESKey(keyLength,commandParams[1].toUpperCase(), commandParams[2],""));
}
else if (commandName.toUpperCase().compareTo("IK") == 0) {
SecureDESKey KEKunderLMK = new SecureDESKey((short)Integer.parseInt(commandParams[3]),
commandParams[4].toUpperCase(), commandParams[5], commandParams[6]);
sm.importKey(keyLength, commandParams[1].toUpperCase(),
ISOUtil.hex2byte(commandParams[2]), KEKunderLMK, true);
}
else if (commandName.toUpperCase().compareTo("KE") == 0) {
SecureDESKey KEKunderLMK = new SecureDESKey((short)Integer.parseInt(commandParams[4]),
commandParams[5].toUpperCase(), commandParams[6], commandParams[7]);
SecureDESKey KEYunderLMK = new SecureDESKey(keyLength, commandParams[1].toUpperCase(),
commandParams[2], commandParams[3] );
sm.exportKey(KEYunderLMK, KEKunderLMK);
}
else {
System.err.println("Unknown command: " + commandName);