In order to thank you for all members' support of our website, we are holding new events - Getting Free Samples by Paying Freight only.
Want to get free samples? Please check this post for more details.

The APDU commands of using PKI host application

An ISO7816 compliant Java Card PKI applet.

Moderator: Ellisun

User avatar
JavaCardOS
Posts: 263
Joined: Thu Apr 30, 2015 12:00 pm
Points :2295
Contact:

The APDU commands of using PKI host application

Post by JavaCardOS » Tue Feb 02, 2016 11:57 pm

After the applet in A40CR card is initialized successfully, the PKI card has been created successfully you can use it for any operation.

The usage of PKI card, there are the following operations:

1. Set and Verify the PIN, the following APDU commands can be used:

Code: Select all

//SetPIN
00 24 00 00 20 30 31 32 33 34 35 36 37 38 39 30 31 32 33 34 35 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38;
//verify PIN
00 20 00 00 10 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38;


2. Get the CA Cert from PKI card:

Code: Select all

//ReadBinary 
 00 B0 00 00 80;
 00 B0 00 80 80;
 00 B0 01 00 80;
 00 B0 01 80 80;
 00 B0 02 00 80;
 00 B0 02 80 80;
 00 B0 03 00 80;
 00 B0 03 80 80;


3. Signature & Authentication, and the sign data "1122" to be signed:

Code: Select all

//Manage Security Environment
00 22 41 B6 07 84 02 00 02 80 01 02;
//Verify
00 20 00 00 10 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38;
//PerformSecurityOperation
 00 2A 9E 9A 21 30 1F 30 07 06 05 2B 0E 03 02 1A 04 14 00 FD 4B 45 49 A1 09 4A AE 92 6E F6 2E 9D BD 3C DC C2 E4 56 80;


4.Signature & Authentication, and the authenticate data is "hello world":

Code: Select all

//ManageSecurityEnvironment
00 22 41 A4 07 84 02 00 01 80 01 01;
//Verify
00 20 00 00 10 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38;
//Process the INTERNAL AUTHENTICATE instruction
00 88 00 00 0B 68 65 6C 6C 6F 20 77 6F 72 6C 64 80;


5. Decrypt Data: to be decrypted data is "test":

Code: Select all

00 22 41 B8 07 84 02 00 03 80 01 01;
00 20 00 00 10 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38;
//PerformSecurityOperation
10 2A 80 86 3C 32 DA ED 39 6A 15 78 95 66 5E BD 76 AC 1B 0C 1F F1 C1 EB EB FA 97 91 BA 5A 27 86 9D 46 38 0F 30 23 3A CD F8 F9 80 3C AD AB 70 B7 EC 94 4B 54 0A 64 5C F9 E0 17 34 05 B0 22 65 EB 65 FF;

00 2A 80 86 44 AD 84 77 CA 5E C0 B5 2F 32 6A 18 3E 56 68 D0 A7 BC 7E B5 02 41 E3 02 24 30 49 5F 2E 8D 86 10 84 FA E5 7C E5 E6 00 97 E0 98 5F 4B 45 8B 17 4F B1 0D 9A 7C 61 9F 08 BB 89 16 D3 F5 08 8E D4 B7 5A 5B C9 92 A4 FF;

Note: The data "test" is encrypted to cipher text by PKI host application, and the cipher text is decrypted to plain text "test" by PKI card.

6. Get Challenge, get challenge with any length generated by PKI card

Code: Select all

//Get challenge length is 8
00 84 00 00 08;
//Get challenge length is 10
 00 84 00 00 0A;

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer