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.

Error 6F00 when generating and verifying a signature

JavaCard Applet Development Related Questions and Answers.
tomc2016
Posts: 12
Joined: Tue Feb 16, 2016 3:45 am
Points :109
Contact:

Error 6F00 when generating and verifying a signature

Post by tomc2016 » Wed Aug 16, 2017 11:11 pm

I am going to generate and verify a signature for some dummy data on a Java Card. It's strange that I always got error code 6F00. I also tried to debug the applet to confirm where the problem is, but failed. Any clue?

Code: Select all

private void signIt(APDU apdu) {
         
          byte[] buffer = apdu.getBuffer();
           
          RSASign = Signature.getInstance(Signature.ALG_RSA_MD5_PKCS1, true);

          RSASign.init(priv, Signature.MODE_SIGN);
     
          byte[] inputData = {0x01, 0x02, 0x03};
          byte[] sig_buffer = new byte[50];
         
                //ISOException.throwIt((short)0x1234); is thrown here

          RSASign.sign(inputData, (short)0, (short)(inputData.length), sig_buffer, (short)0);
             //ISOException.throwIt((short)0x1234); not thrown anymore - Instead 6F00 is thrown     

          Sig = sig_buffer;
     }

     private void verifyIt(APDU apdu) {
         
          byte[] buffer = apdu.getBuffer();
         
          byte[] inputData = {0x01, 0x02, 0x03};
         
          // sigOffset correct?
          if (RSASign.verify(inputData, (short)0, (short)(inputData.length), realSig,
                   (short)0, (short)(realSig.length)) != true) {
                        ISOException.throwIt(SW_WRONG_SIGNATURE); //unknown error thrown again
         }
         
     }

User avatar
lostsiwonlw
Posts: 55
Joined: Fri Jul 31, 2015 9:09 pm
Points :358
Contact:

Re: Error 6F00 when generating and verifying a signature

Post by lostsiwonlw » Thu Aug 17, 2017 5:12 am

Try to change the sig_buffer to a bigger balue. RSA Signature alone is 128 Bytes.
Searching for meaning...

tomc2016
Posts: 12
Joined: Tue Feb 16, 2016 3:45 am
Points :109
Contact:

Re: Error 6F00 when generating and verifying a signature

Post by tomc2016 » Thu Aug 17, 2017 6:04 am

I changed the sig_buffer to 200, and the sign function is working now :D ,but the verify function still throws error 0x6F00.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 45 guests

JavaCard OS : Disclaimer