5

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.

Slobodan
  • 109
  • 1
  • 10
  • As you may have found out by now, Microsoft uses a different API than PKCS#11 for crypto libraries. – Maarten Bodewes Dec 04 '12 at 23:35
  • yes that was a rude awakening :) but this problem still remained unresolved – Slobodan Dec 05 '12 at 13:48
  • Did you look at the [MSCAPI provider](http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunMSCAPI) to see if that is applicable? Sorry, just looking through the backlogs... – Maarten Bodewes Dec 31 '12 at 10:47
  • 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 Dec 31 '12 at 22:50

1 Answers1

0

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.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
mstred
  • 36
  • 4