5
votes

I am working on migration of an old project to Java, and I am having some issues regarding smart card access. Due to lack of documentation I am forced to find my own way through this one, so I hoped you people can help me.

I have a smart card and a dll library (middleware) that was used to gain access to cards functions. Using dependency walker I managed to get a list of functions that dll library holds, and that list sums up to Microsoft Smart Card Api functions. I was wondering if there is some native wrapper that enables me to call that functions from Java?

Regarding the nature of smart card, it should contain cryptography functions (PKCS#11), but I wasn't able to instantiate a sun.security.pkcs11.SunPKCS11 provider because of this error:

Caused by: java.io.IOException: The specified procedure could not be found.
     at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)

Any guideline will be appreciated.

Thanks in advance

UPDATE:

For anyone having this problem as well, it turns out that my smart card doesn't support PKCS11 and I don't have appropriate PKCS11 dll.

1
As you may have found out by now, Microsoft uses a different API than PKCS#11 for crypto libraries.Maarten Bodewes
yes that was a rude awakening :) but this problem still remained unresolvedSlobodan
Did you look at the MSCAPI provider to see if that is applicable? Sorry, just looking through the backlogs...Maarten Bodewes
yes MSCAPI provider is applicable when dll library (minidriver) is correctly programmed. After some strugle I found out that minidriver is not working well, so only way I could use it is by directly calling WIN CAPI, making me write some c++ code and bridge it to java..Slobodan

1 Answers

0
votes

Well, I recently worked in a project which used to have Smart Card access for PKI Certificates and there we had the help from these two frameworks:

I think that the second option shall be something that might help you too.