Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

Throw exception :6982 when returning encrypted data

Algorithm School

Moderator: UNKNwYSHSA

JCaberham
Posts: 26
Joined: Mon Nov 30, 2015 3:02 am
Points :208
Contact:

Throw exception :6982 when returning encrypted data

Post by JCaberham » Mon Nov 30, 2015 3:29 am

I need to use SecureChannel.encryptData() function to encrypt data. I want Global Platform to encrypt data and later I will decrypt it with the correct session key.

The code below is to encrypt the APDU buffer, which expected a response APDU with encrypted 20.

Code: Select all

byte buffer = apdu.getBuffer();
buffer[0] = 20;
short lc = chan.encryptData(buffer, (short) 0, (short) 1);
apdu.setOutgoingAndSend((short) 0, lc);


But this returns an error SW 6982, which means "security condition not satisfied".

Where did I make mistakes? Any help is thankful.

User avatar
UNKNwYSHSA
Posts: 630
Joined: Thu May 21, 2015 4:05 am
Points :3053
Contact:

Re: Throw exception :6982 when returning encrypted data

Post by UNKNwYSHSA » Mon Nov 30, 2015 10:56 pm

Did you establish secure channel (INITIALIZE UPDATE and EXTERNAL AUTHENTICATE command are both succeeded) before call the encryptData() method?
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 46 guests

JavaCard OS : Disclaimer