Page 1 of 1

How do I create a certificate in javacard?

Posted: Mon Jul 17, 2017 3:08 am
by sla1023
Forgive my short English skills first

I would like to generate a certificate from javacard

I want to check the generated certificate through openssl on another device

Please tell me how to use javacard to create a certificate available in openssl

Thank you

Re: How do I create a certificate in javacard?

Posted: Mon Jul 17, 2017 6:15 am
by UNKNwYSHSA
1 Generate keypair in the JavaCard;
2 Output the public key;
3 Build one certificate object with the public key and other informations using middleware;
4 Store the certificate object into the JavaCard, it can be directly readed from JavaCard next time it used.
I'll find code sample for you, wait me.

Re: How do I create a certificate in javacard?

Posted: Mon Jul 17, 2017 11:09 am
by sla1023
Thank you for your reply.

I'll wait for your sample code.

Re: How do I create a certificate in javacard?

Posted: Tue Jul 18, 2017 11:31 pm
by UNKNwYSHSA
Here's no exists code for you.

See https://en.wikipedia.org/wiki/Public_key_certificate
The following image shows how to generate a certificate.

Re: How do I create a certificate in javacard?

Posted: Wed Jul 19, 2017 3:14 am
by sla1023
Thank you for the reply

I have a one more question

The certificate has various variables, so it seems to be created as a class.

So how do you store the class data on the Java Card?

Thank you for your kindness

Re: How do I create a certificate in javacard?

Posted: Wed Jul 19, 2017 3:50 am
by UNKNwYSHSA
You can define 2 method:

Code: Select all

// Serialize variables to a byte array.
// Then store data bytes to javacard.
byte[] toBytes();


Code: Select all

// After reading data bytes from javacard,
// UnSerialize variables from the byte array, build one Certificate class instance using these variables.
Certificate fromBytes(byte[] data);