NCryptoki

 

How to store a X509 certificate in a smartcard token using JCrypt?

3/31/2015 6:02:17 PM
Gravatar
Total Posts 3

How to store a X509 certificate in a smartcard token using JCrypt?

I've been trying to replicate the code in NCrypt samples but i can't get it to work in Java. I have doubts on the fields for the template and i believe that i've been filling them in a wrong way because my smartcards become unusable, reporting a CKR_GENERAL_ERROR, (C_GetAttributeValue 0x5) when I try to use ordinary applications to visualize the certificates inside. I'm able to generate keys and visualize certificates that i imported with other software. Can't store the ones imported using JCrypt. Any tips?
4/1/2015 11:01:21 AM
Gravatar
Total Posts 300
Ugo Chirico http://www.ugochirico.com

Re: How to store a X509 certificate in a smartcard token using JCrypt?

Probably you are using a wrong template.

Can you post your template?

4/1/2015 2:45:40 PM
Gravatar
Total Posts 3

Re: How to store a X509 certificate in a smartcard token using JCrypt?

Hi, The template is similar do the one on the documentation except adapted to java, the attribute values i'm not so sure though. I've found out that i'm not being able to set some of the attributes, such as CKA_VALUE. I'm importing a .cer file from the harddrive and trying to fill the template attributes with the ones i get from the certificate file. After creating the certificate in the smartcard, if i try to print the attributes, the Certificate Value appears as NULL. In which way do I have to pass the certificate bytes to the template? Do you have a java sample?
http://www.ncryptoki.com/Forums/Thread.aspx?pageid=9&t=193~1