@Test public void testProcessVerifyPin_plain_outside_secureSession() { CalypsoPo calypsoPoRev31 = createCalypsoPo(FCI_REV31); poTransaction = new PoTransaction(new SeResource<CalypsoPo>(poReader, calypsoPoRev31)); poCommandsTestSet.put(PO_VERIFY_PIN_PLAIN_OK_CMD, PO_VERIFY_PIN_OK_RSP); poTransaction.processVerifyPin(PIN_OK); assertThat(calypsoPoRev31.getPinAttemptRemaining()).isEqualTo(3); }
public final void processVerifyPin(byte[] pin) { Assert.getInstance() .notNull(pin, "pin") .isEqual(pin.length, CalypsoPoUtils.PIN_LENGTH, "PIN length"); if (!calypsoPo.isPinFeatureAvailable()) { throw new CalypsoPoTransactionIllegalStateException("PIN is not available for this PO."); } if (poCommandManager.hasCommands()) { throw new CalypsoPoTransactionIllegalStateException( "No commands should have been prepared prior to a PIN submission."); } if (poSecuritySettings != null && PinTransmissionMode.ENCRYPTED.equals(poSecuritySettings.getPinTransmissionMode())) { poCommandManager.addRegularCommand(new PoGetChallengeCmdBuild(calypsoPo.getPoClass())); processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), ChannelControl.KEEP_OPEN); poCommandManager.notifyCommandsProcessed(); byte[] cipheredPin = samCommandProcessor.getCipheredPinData(CalypsoPoUtils.getPoChallenge(), pin, null); poCommandManager.addRegularCommand( new VerifyPinCmdBuild( calypsoPo.getPoClass(), PinTransmissionMode.ENCRYPTED, cipheredPin)); } else { poCommandManager.addRegularCommand( new VerifyPinCmdBuild(calypsoPo.getPoClass(), PinTransmissionMode.PLAIN, pin)); } processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), channelControl); poCommandManager.notifyCommandsProcessed(); }
PoTransaction { public final void processVerifyPin(byte[] pin) { Assert.getInstance() .notNull(pin, "pin") .isEqual(pin.length, CalypsoPoUtils.PIN_LENGTH, "PIN length"); if (!calypsoPo.isPinFeatureAvailable()) { throw new CalypsoPoTransactionIllegalStateException("PIN is not available for this PO."); } if (poCommandManager.hasCommands()) { throw new CalypsoPoTransactionIllegalStateException( "No commands should have been prepared prior to a PIN submission."); } if (poSecuritySettings != null && PinTransmissionMode.ENCRYPTED.equals(poSecuritySettings.getPinTransmissionMode())) { poCommandManager.addRegularCommand(new PoGetChallengeCmdBuild(calypsoPo.getPoClass())); processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), ChannelControl.KEEP_OPEN); poCommandManager.notifyCommandsProcessed(); byte[] cipheredPin = samCommandProcessor.getCipheredPinData(CalypsoPoUtils.getPoChallenge(), pin, null); poCommandManager.addRegularCommand( new VerifyPinCmdBuild( calypsoPo.getPoClass(), PinTransmissionMode.ENCRYPTED, cipheredPin)); } else { poCommandManager.addRegularCommand( new VerifyPinCmdBuild(calypsoPo.getPoClass(), PinTransmissionMode.PLAIN, pin)); } processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), channelControl); poCommandManager.notifyCommandsProcessed(); } }
PoTransaction { public final void processVerifyPin(byte[] pin) { Assert.getInstance() .notNull(pin, "pin") .isEqual(pin.length, CalypsoPoUtils.PIN_LENGTH, "PIN length"); if (!calypsoPo.isPinFeatureAvailable()) { throw new CalypsoPoTransactionIllegalStateException("PIN is not available for this PO."); } if (poCommandManager.hasCommands()) { throw new CalypsoPoTransactionIllegalStateException( "No commands should have been prepared prior to a PIN submission."); } if (poSecuritySettings != null && PinTransmissionMode.ENCRYPTED.equals(poSecuritySettings.getPinTransmissionMode())) { poCommandManager.addRegularCommand(new PoGetChallengeCmdBuild(calypsoPo.getPoClass())); processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), ChannelControl.KEEP_OPEN); poCommandManager.notifyCommandsProcessed(); byte[] cipheredPin = samCommandProcessor.getCipheredPinData(CalypsoPoUtils.getPoChallenge(), pin, null); poCommandManager.addRegularCommand( new VerifyPinCmdBuild( calypsoPo.getPoClass(), PinTransmissionMode.ENCRYPTED, cipheredPin)); } else { poCommandManager.addRegularCommand( new VerifyPinCmdBuild(calypsoPo.getPoClass(), PinTransmissionMode.PLAIN, pin)); } processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), channelControl); poCommandManager.notifyCommandsProcessed(); } PoTransaction(SeResource<CalypsoPo> poResource, PoSecuritySettings poSecuritySettings);  PoTransaction(SeResource<CalypsoPo> poResource); }
PoTransaction { public final void processVerifyPin(byte[] pin) { Assert.getInstance() .notNull(pin, "pin") .isEqual(pin.length, CalypsoPoUtils.PIN_LENGTH, "PIN length"); if (!calypsoPo.isPinFeatureAvailable()) { throw new CalypsoPoTransactionIllegalStateException("PIN is not available for this PO."); } if (poCommandManager.hasCommands()) { throw new CalypsoPoTransactionIllegalStateException( "No commands should have been prepared prior to a PIN submission."); } if (poSecuritySettings != null && PinTransmissionMode.ENCRYPTED.equals(poSecuritySettings.getPinTransmissionMode())) { poCommandManager.addRegularCommand(new PoGetChallengeCmdBuild(calypsoPo.getPoClass())); processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), ChannelControl.KEEP_OPEN); poCommandManager.notifyCommandsProcessed(); byte[] cipheredPin = samCommandProcessor.getCipheredPinData(CalypsoPoUtils.getPoChallenge(), pin, null); poCommandManager.addRegularCommand( new VerifyPinCmdBuild( calypsoPo.getPoClass(), PinTransmissionMode.ENCRYPTED, cipheredPin)); } else { poCommandManager.addRegularCommand( new VerifyPinCmdBuild(calypsoPo.getPoClass(), PinTransmissionMode.PLAIN, pin)); } processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), channelControl); poCommandManager.notifyCommandsProcessed(); } PoTransaction(SeResource<CalypsoPo> poResource, PoSecuritySettings poSecuritySettings);  PoTransaction(SeResource<CalypsoPo> poResource); final void processOpening(PoTransaction.SessionSetting.AccessLevel accessLevel); final void processPoCommands(); final void processClosing(); final void processCancel(); final void processVerifyPin(byte[] pin); final void processVerifyPin(String pin); final void prepareReleasePoChannel(); final void prepareSelectFile(byte[] lid); final void prepareSelectFile(SelectFileControl control); final void prepareReadRecordFile(byte sfi, int recordNumber); final void prepareReadRecordFile(
      byte sfi, int firstRecordNumber, int numberOfRecords, int recordSize); final void prepareReadCounterFile(byte sfi, int countersNumber); final void prepareAppendRecord(byte sfi, byte[] recordData); final void prepareUpdateRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareWriteRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareIncreaseCounter(byte sfi, int counterNumber, int incValue); final void prepareDecreaseCounter(byte sfi, int counterNumber, int decValue); final void prepareCheckPinStatus(); final void prepareSvGet(SvSettings.Operation svOperation, SvSettings.Action svAction); final void prepareSvReload(int amount, byte[] date, byte[] time, byte[] free); final void prepareSvReload(int amount); final void prepareSvDebit(int amount, byte[] date, byte[] time); final void prepareSvDebit(int amount); final void prepareSvReadAllLogs(); final void prepareInvalidate(); final void prepareRehabilitate(); }
PoTransaction { public final void processVerifyPin(byte[] pin) { Assert.getInstance() .notNull(pin, "pin") .isEqual(pin.length, CalypsoPoUtils.PIN_LENGTH, "PIN length"); if (!calypsoPo.isPinFeatureAvailable()) { throw new CalypsoPoTransactionIllegalStateException("PIN is not available for this PO."); } if (poCommandManager.hasCommands()) { throw new CalypsoPoTransactionIllegalStateException( "No commands should have been prepared prior to a PIN submission."); } if (poSecuritySettings != null && PinTransmissionMode.ENCRYPTED.equals(poSecuritySettings.getPinTransmissionMode())) { poCommandManager.addRegularCommand(new PoGetChallengeCmdBuild(calypsoPo.getPoClass())); processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), ChannelControl.KEEP_OPEN); poCommandManager.notifyCommandsProcessed(); byte[] cipheredPin = samCommandProcessor.getCipheredPinData(CalypsoPoUtils.getPoChallenge(), pin, null); poCommandManager.addRegularCommand( new VerifyPinCmdBuild( calypsoPo.getPoClass(), PinTransmissionMode.ENCRYPTED, cipheredPin)); } else { poCommandManager.addRegularCommand( new VerifyPinCmdBuild(calypsoPo.getPoClass(), PinTransmissionMode.PLAIN, pin)); } processAtomicPoCommands(poCommandManager.getPoCommandBuilders(), channelControl); poCommandManager.notifyCommandsProcessed(); } PoTransaction(SeResource<CalypsoPo> poResource, PoSecuritySettings poSecuritySettings);  PoTransaction(SeResource<CalypsoPo> poResource); final void processOpening(PoTransaction.SessionSetting.AccessLevel accessLevel); final void processPoCommands(); final void processClosing(); final void processCancel(); final void processVerifyPin(byte[] pin); final void processVerifyPin(String pin); final void prepareReleasePoChannel(); final void prepareSelectFile(byte[] lid); final void prepareSelectFile(SelectFileControl control); final void prepareReadRecordFile(byte sfi, int recordNumber); final void prepareReadRecordFile(
      byte sfi, int firstRecordNumber, int numberOfRecords, int recordSize); final void prepareReadCounterFile(byte sfi, int countersNumber); final void prepareAppendRecord(byte sfi, byte[] recordData); final void prepareUpdateRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareWriteRecord(byte sfi, int recordNumber, byte[] recordData); final void prepareIncreaseCounter(byte sfi, int counterNumber, int incValue); final void prepareDecreaseCounter(byte sfi, int counterNumber, int decValue); final void prepareCheckPinStatus(); final void prepareSvGet(SvSettings.Operation svOperation, SvSettings.Action svAction); final void prepareSvReload(int amount, byte[] date, byte[] time, byte[] free); final void prepareSvReload(int amount); final void prepareSvDebit(int amount, byte[] date, byte[] time); final void prepareSvDebit(int amount); final void prepareSvReadAllLogs(); final void prepareInvalidate(); final void prepareRehabilitate();  }