Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reusing Java Keystore when accessing a smartcard on Windows

I'm developing an application which uses SUNMSCAPI to access a smartcard (electronic id) and retrieve some certificates.

Until a while back I could create the keystore and sign a list of files, without re-creating the keystore but now I can only sign one file at a time.

When signing a list of files the first file is signed correctly; when signing the second file I get an "insert smartcard" dialog and the smartcard being used is greyed out.

Has anyone seen this behaviour?

like image 292
Rui Caridade Avatar asked May 21 '12 17:05

Rui Caridade


1 Answers

Yes, I have seen this before.

I was developing the front end and middleware for the Portuguese ID card to be used online and one particular feature was to be able to sign more than one file (electronically sign) and this was the exact behaviour we had!

The security model on smartcards ensure that one authentication lasts only one action. Signing a file is one action so we had to cache the authentication details (PIN code) and loop over the authentication procedure for every file we wished to sign.

like image 73
ricardoespsanto Avatar answered Sep 28 '22 16:09

ricardoespsanto