PIN, smart cards, and multiple files
- From: Xavier <x_aver@xxxxxxxxxx>
- Date: Thu, 09 Nov 2006 16:42:51 +0100
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
.
- Follow-Ups:
- Re: PIN, smart cards, and multiple files
- From: Frank-Michael Schulte-Krude
- Re: PIN, smart cards, and multiple files
- Prev by Date: Re: SChannel CSP
- Next by Date: Re: serializing encrypted data to a file using x509 public certificate.
- Previous by thread: How to disappear completely the CSP login screen
- Next by thread: Re: PIN, smart cards, and multiple files
- Index(es):
Relevant Pages
|