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.

Want to know how unwrap send command works.

JavaCard Applet Development Related Questions and Answers.
mohit846
Posts: 3
Joined: Thu May 03, 2018 1:17 am
Points :200
Location: Bangalore
Contact:

Want to know how unwrap send command works.

Post by mohit846 » Fri May 11, 2018 1:45 am

i am unable to send command for unwrap line of code.
everytime its showing 69 85 error msg.

How will i can get 90 00 success message for unwrap command?

Thanks in advance
from ,
Mohit Kumar :!:

nozomi
Posts: 6
Joined: Tue May 08, 2018 7:04 pm
Points :38
Contact:

Re: Want to know how unwrap send command works.

Post by nozomi » Fri May 11, 2018 6:02 am

Are you talking about unwrap method of SecureChannel interface in Global Platform specification?
Maybe it would be helpful for your question to unload some code snippets or simplified project files.

mohit846
Posts: 3
Joined: Thu May 03, 2018 1:17 am
Points :200
Location: Bangalore
Contact:

Re: Want to know how unwrap send command works.

Post by mohit846 » Fri May 11, 2018 2:32 pm

can u provide some basic code related to unmask ?

The problem which i am facing is that i am not getting success message for PUT_KEY instruction.

(>> /send 80D800000102
>> 80 D8 00 00 01 02
<< 69 85 Conditions of use not satisfied

>> /send 80D80000020101
>> 80 D8 00 00 02 01 01
<< 69 85 Conditions of use not satisfied)


I am sending some piece of code .If possible please go through it and if u can help me, it will be greatful .


final static byte CLA_Proprietary = (byte) 0x80;
final static byte INS_PUT_KEY = (byte) 0xD8;

switch ( buffer[ISO7816.OFFSET_INS] ) {
// PUT KEY command
case (byte) INS_PUT_KEY:
personalize( apdu );
break;

void personalize( APDU apdu ) {

// The applet checks its own state to insure it is not already personalized.
if( GPSystem.getCardContentState() != GPSystem.APPLICATION_SELECTABLE )
ISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);

byte[] buffer = apdu.getBuffer();

// The personalization data is retrieved and the command is unwrapped by the
// Security Domain.
// Errors in the unwrapping process are managed and output by the Security Domain.
wrappedLength = apdu.setIncomingAndReceive();
MySecureChannel.unwrap(buffer, (short) ISO7816.OFFSET_CLA,(short) (wrappedLength+5)); --------------------after this line only i am getting
error 69 85 , on sending /send apdu .

byte pinLen = buffer[ISO7816.OFFSET_LC];
MyPIN.update(buffer, (short)(ISO7816.OFFSET_CDATA), pinLen, CVM.FORMAT_HEX);

// As the application now contains personalization data, it's Life Cycle
// State transitions to its own specific state ¡°Personalized¡±.
GPSystem.setCardContentState( APPLET_PERSONALIZED );

}


Thanks in advance ,
Mohit kumar
from ,
Mohit Kumar :!:

roundtable
Posts: 18
Joined: Mon Sep 18, 2017 9:52 pm
Points :240
Contact:

Re: Want to know how unwrap send command works.

Post by roundtable » Tue May 15, 2018 8:25 am

The PUT Key command shall run on established secure channel, so you applet must proess the 'initialize update ' and 'external authenticate' commands first just like below :

switch (ins)
case INITIALIZE_UPDATE:
apdu.setOutgoingAndSend((short) 5, GPSystem.getSecureChannel().processSecurity(apdu));
break;
case EXTERNAL_AUTHENTICATE:
GPSystem.getSecureChannel().processSecurity(apdu);
break;
correspondingly, before PUT KEY, those two APDU commands shall be sent first. PUT KEY command shall be constructed following GP spec,not your simple command.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 23 guests

JavaCard OS : Disclaimer