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.

Problem in coding output data

JavaCard Applet Development Related Questions and Answers.
aahmadzadeh
Posts: 27
Joined: Mon Sep 28, 2015 2:31 am
Points :400
Contact:

Problem in coding output data

Post by aahmadzadeh » Sat Apr 08, 2017 5:54 am

What do you think about this codes?
Why we get plain data as output ?

Code: Select all

if(secureChannel.getSecurityLevel() != (byte)0x83)
   ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
            
byte[] data= new byte[] {(byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44, (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88};
Util.arrayCopyNonAtomic(data, (short)0, apdu.getBuffer(), (short)0, (short)data.length);
short length = secureChannel.wrap(apdu.getBuffer(), (short)0, (short)data.length);
apdu.setOutgoingAndSend((short)0, length);

output: 11 22 33 44 55 66 77 88

:?:

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

Re: Problem in coding output data

Post by UNKNwYSHSA » Sun Apr 09, 2017 10:25 pm

Did you want to encrypt the response data and/or generate MAC for response data?

Code: Select all

/**
    * The <code>wrap</code> method will encrypt the outgoing response data (0x20).
    * <p>Note:<ul>
    * <li><em>Response data encryption could be indicated along with entity authentication and one
    * or more levels of security.</em>
    */
   public static final byte R_ENCRYPTION = (byte) 0x20;

   /**
    * The <code>wrap</code> method will generate a MAC for the outgoing response data (0x10).
    * <p>Note:<ul>
    * <li><em>MAC generation could be indicated along with entity authentication and one or more
    * levels of security, e.g. a value of '91' indicates that entity authentication has occurred,
    * that the <code>unwrap</code> method will verify the MAC on incoming commands and that the
    * <code>wrap</code> method will generate a MAC on outgoing response data.</em>
    */
   public static final byte R_MAC = (byte) 0x10;

The security level shall mask these bit(s).
sense and simplicity

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 64 guests

JavaCard OS : Disclaimer