java - Encrypting data using smart card private key -


i trying use applet in web application encrypt data using smart card. following link: http://www.developer.com/java/other/article.php/3587361/java-applet-for-signing-with-a-smart-card.htm

i able read certificates stored in smartcard , encrypt data using certificates. requires me pass location of pkcs#11 implementation library file(.dll) , smart card pin.

my functional requirement load list of certificates single(or multiple) smart cards connected system without passing .dll filepath. ofcourse, when user selects certificate signing he/she enter pin.

is possible extract certificate details smartcard without passing location of pkcs#11 implementation library file(.dll)

implementation:

pkcs11libraryfileandpincodedialog localpkcs11libraryfileandpincodedialog = new pkcs11libraryfileandpincodedialog();  boolean bool;  try {   bool = localpkcs11libraryfileandpincodedialog.run();  } {   localpkcs11libraryfileandpincodedialog.dispose(); } if (bool) {   string str2 = this.msignbutton.getlabel();   this.msignbutton.setlabel("working...");   this.msignbutton.setenabled(false);   try   {     string str3 = localpkcs11libraryfileandpincodedialog.getlibraryfilename();     string str4 = localpkcs11libraryfileandpincodedialog.getsmartcardpincode();     smartcardsignerapplet.certificationchainandsignaturebase64 localcertificationchainandsignaturebase641 = signdocument(arrayofbyte, str3, str4);   } 

the short answer "no." when interacting smart cards, java passes pkcs#11 requests on .dll file interacts card, need provide .dll file interact smart card , read certificates.

you might able without .dll file, think amount rewriting .dll code yourself. understanding different smart cards have different apis, , .dll files used access them provide standard pkcs#11 api, rather implement smart card apis, java libraries smart card access use pkcs#11 interface provided .dll file.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -