GetDataFciRespPars extends AbstractPoResponseParser { public boolean isValidCalypsoFCI() { return isValidCalypsoFCI; } GetDataFciRespPars(ApduResponse response, GetDataFciCmdBuild builder); boolean isValidCalypsoFCI(); byte[] getDfName(); byte[] getApplicationSerialNumber(); byte[] getDiscretionaryData(); boolean isDfInvalidated();  }
@Test public void testFCIparser_FCI_BadTags() { String dfName = "00112233445566778899"; String appSerialNumber = "AABBCCDDEEFF0011"; byte siBufferSizeIndicator = 11; byte siPlatform = (byte) 0x55; byte siApplicationType = (byte) 0xAA; byte siApplicationSubtype = (byte) 0x55; byte siSoftwareIssuer = (byte) 0xAA; byte siSoftwareVersion = (byte) 0x55; byte siSoftwareRevision = (byte) 0xAA; String startupInformation = String.format( "%02X%02X%02X%02X%02X%02X%02X", siBufferSizeIndicator, siPlatform, siApplicationType, siApplicationSubtype, siSoftwareIssuer, siSoftwareVersion, siSoftwareRevision); ApduResponse apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "4F 24 84 0A " + dfName + " A5 16 BF0C 13 C7 08 " + appSerialNumber + " 53 07 " + startupInformation + "9000"), null); GetDataFciRespPars parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "6F 24 C4 0A " + dfName + " A5 16 BF0C 13 C7 08 " + appSerialNumber + " 53 07 " + startupInformation + "9000"), null); parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "6F 24 84 0A " + dfName + " 85 16 BF0C 13 C7 08 " + appSerialNumber + " 53 07 " + startupInformation + "9000"), null); parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "6F 24 84 0A " + dfName + " A5 16 BF0D 13 C7 08 " + appSerialNumber + " 53 07 " + startupInformation + "9000"), null); parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "6F 24 84 0A " + dfName + " A5 16 BF0C 13 87 08 " + appSerialNumber + " 53 07 " + startupInformation + "9000"), null); parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); apduResponse = new ApduResponse( ByteArrayUtil.fromHex( "6F 24 84 0A " + dfName + " A5 16 BF0C 13 C7 08 " + appSerialNumber + " 43 07 " + startupInformation + "9000"), null); parser = new GetDataFciRespPars(apduResponse, null); Assert.assertFalse(parser.isValidCalypsoFCI()); }