JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
Want to know how unwrap send command works.
Want to know how unwrap send command works.
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
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
Mohit Kumar

Re: Want to know how unwrap send command works.
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.
Maybe it would be helpful for your question to unload some code snippets or simplified project files.
Re: Want to know how unwrap send command works.
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
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
Mohit Kumar

-
- Posts: 18
- Joined: Mon Sep 18, 2017 9:52 pm
- Points :240
- Contact:
Re: Want to know how unwrap send command works.
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.
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.
Who is online
Users browsing this forum: Google [Bot] and 47 guests