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!

Result signature between signature from Applet and Java code

An ISO7816 compliant Java Card PKI applet.

Moderator: Ellisun

dinhkhacnam
Posts: 4
Joined: Thu Sep 14, 2017 10:57 pm
Points: 64
Contact:

Result signature between signature from Applet and Java code

Postby dinhkhacnam » Mon Sep 18, 2017 12:36 am

Hi all,
I have tested with PKI applet from github (https://github.com/JavaCardOS/Java-Card-PKI-Applet), I run samcode to get signature, then i convert signcert.der to create signature with java code (data inputs are one)

But i got result different with PKI applet

Here is my code in java code

Code: Select all

Signature sig = Signature.getInstance("Sha1WithRSA");
           
            sig.initSign(myPrivKey);
            sig.update(data);
            byte [] sign = sig.sign();
            System.out.println("Sign Data Done! \n");

roundtable
Posts: 14
Joined: Mon Sep 18, 2017 9:52 pm
Points: 168
Contact:

Re: Result signature between signature from Applet and Java code

Postby roundtable » Tue Oct 10, 2017 2:11 am

Signature sig = Signature.getInstance("Sha1WithRSA"); where alg name 'shawithRSA" is ambitious, i 've gone through the java API spec. 'shawithRSA" only indicates that PKCS#1 is used, however, PKCS#1 is comprised of Padding (PSS, Vi5 and OAEP), cipher primitives, but they are described in details in javacard APIs .

So, you modify your applet to try these constants: Signature.ALG_RSA_SHA_PKCS1, Signature.ALG_RSA_SHA_PKCS1_PSS
until you get the same result as your java code.


Return to “PKIApplet”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer