Find a way to open a secure channel
Posted: Mon Dec 21, 2015 3:09 am
I wrote an applet and it always returned "0x6982"(Security condition not satisfied).
Here is part of code:
After a hard search on the web, I find that I need to open a secure channel first. But where can I find a way to open the secure channel? Does anyone have clue about this? Thanks in advance
Here is part of code:
Code: Select all
byte[] header = {(byte)0x02, (byte)0x01, (byte)0x01};
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
outputStream.write(header);
outputStream.write(Value.SN.getBytes());
byte[] excpectedRes = outputStream.toByteArray();
ResponseAPDU answer = channel.transmit(new CommandAPDU(0x84, 0xCA, 0x02, 0x01, Value.Emptydata));
nameTest = "Test Select Serial number " + answer.toString();
CheckSW(0x90, 00, answer);
CheckResult(excpectedRes, result);
After a hard search on the web, I find that I need to open a secure channel first. But where can I find a way to open the secure channel? Does anyone have clue about this? Thanks in advance