views:

271

answers:

1

Hi I am trying to sign an XML document with the Micrisift API for the smart cards...

So far I can list the card readers, connect to the right card and establish the context but after that I am not sure what is next......

What PC/SC Functions Do I need to call to sign a document with a private smartcard key?

thanks in advance

Javier

+1  A: 

If you have a middleware installed you can use the Windows CAPI for cryptographic functions. Some middlewares also ship a PKCS#11 library you can use. If you don't have any middleware you have to do it yourself using the PC/SC interface, I suggest you look into ISO/IEC 7816-4 and ISO/IEC 7816-8 if the card is using Secure Messaging (or Sado Machism if you ask me). Unfortunately those ISO specs are quite expensive, however you can find some excerpts from ISO/IEC 7816-4 right here. The ISO/IEC 7816-4 describe the APDU commands for information exchange with the card. The PKCS#15 standard can also be of great help regarding how files are stored on the card.

Also, you might need the full specification from the card manufacturer. If you are lucky you can find a plugin for your card in the MuscleCard project or the OpenSC project (they both work in Windows too).

Jonas Gulle