Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

About generateAsymetricKey() function

Open source implementation of the OpenPGP smart card version 2.0 on a java card.

Moderator: Ellisun

bigWhite
Posts: 25
Joined: Tue Aug 25, 2015 8:21 am
Points: 164
Contact:

About generateAsymetricKey() function

Postby bigWhite » Tue Dec 15, 2015 5:32 am

From the source code, generateAsymetricKey()function is to generate three types KEY pairs, and the types of key pairs are:
signatureKey, confidentialityKey and authenticationKey.

But, when I send APDU, only signatureKey (OFFSET_CDATA, is 0xB6) generated successfully, the others all returned 0x6A82.
WHY???

My sending APDU commands are:

Code: Select all

>> 00 20 00 82 06 31 32 33 34 35 36
<< 90 00

>> 00 20 00 83 08 31 32 33 34 35 36 37 38
<< 90 00

>> 00 20 00 83 08 31 32 33 34 35 36 37 38
<< 90 00

>> 80 47 81 00 01 B8
<< 6A 82   File or application not found

>> 80 47 81 00 01 B6
<< 7F 49 82 01 09 82 03 01 00 01 81 82 01 00 61 00   Response bytes remaining

>> 00 C0 00 00
<< 90 00

>> 80 47 81 00 01 A4
<< 6A 82   File or application not found


predators
Posts: 21
Joined: Wed Aug 19, 2015 7:18 am
Points: 12
Contact:

Re: About generateAsymetricKey() function

Postby predators » Wed Dec 16, 2015 5:51 am

While sending APDU command, the P1 of your incoming APDU is 0x81,

Code: Select all

if (buffer[ISO7816.OFFSET_P1] == (byte) 0x81) {
      if (!(key.getPublic()).isInitialized()) {
        ISOException.throwIt(ISO7816.SW_FILE_NOT_FOUND);
      }
    }
   

From the code, it will check the KEY isInitialized(), Maybe the corresponding Key is not initialized.

And I debug this applet, after I select the applet and verify the PIN1, PIN3, I send the APDU is "8047810001 KeyTypes", no matter what key types, the response APDU are all 0x6A82.


Return to “FluffyPGPApplet”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer