PIN, smart cards, and multiple files



Hi,

I am writing a piece of software that is supposed to digitally sign a group of files (thousands) using an arbitrary certificate, including the one present on smart card.
I've searched the groups, but I can't find the proper solution. When I am using non-smartcard certificate (no PIN or password), then evreything works. However when i choose certificate from smart card, the PIN dialog is displayed each time I execute the CryptSignMessage function.

What I am doing is:
1. Initiate everything by
- Opening Store via CertOpenStore
- finding certificate via CertFindCertificateInStore
- to cache the certificate, I tried to use CryptAcquireCertificatePrivateKey and CryptGetUserKey, but to no avail.
No PIN dialog is displayed at this stage.
2. Sign each file in the loop by
- loading file to buffer
- executing CryptSignMessage (each time the PIN dialog is displayed)
- saving file

I am certainly missing something here. Is it possible to "cache" all the structures so the PIN will be taken only once from user during the init phase of first signature? Is it possible to get the private key from the smart card and perform subsequent signatures without this PIN dialog? I thought that CryptAcquireCertificatePrivateKey function will allow me to do this. I don't know the PINs so I can't pass them programatically.

I'll be grateful for any help.

Thanx,
X-aver
.



Relevant Pages

  • Re: How I can display smart card PIN dialog ?
    ... PIN prompt because the certificate is added to the user profile store. ... >I want to write 802.1x authentication by smart card. ...
    (microsoft.public.platformsdk.security)
  • How I can display smart card PIN dialog ?
    ... I want to write 802.1x authentication by smart card. ... So I need read certificate in smart card. ... I find similar sample code for ... PIN dialog doesn't pop up. ...
    (microsoft.public.platformsdk.security)
  • Re: Updates for 06
    ... A sticker and certificate makes what sense. ... the great job Chris does, but once the game leaves his hands, there is no ... It becomes a regular pin which if you are thinking ...
    (rec.games.pinball)
  • Re: PIN, smart cards, and multiple files
    ... you could have a look at Aloahas Smart Card API. ... group of files using an arbitrary certificate, ... However when i choose certificate from smart card, the PIN dialog ... phase of first signature? ...
    (microsoft.public.platformsdk.security)
  • Re: CERTREQ for smart card not working
    ... and inserted in the issued certificate. ... Subject in the request. ... (PROMPTED FOR PIN - ENTER PIN) ... (PROMPTED FOR PROPER ENROLLMENT AGENT CERT IN MY STORE) ...
    (microsoft.public.platformsdk.security)

Quantcast