Problem with CryptSignMessage use in GINA DLL

From: Ron Currier (rcurrier)
Date: 04/29/04

  • Next message: alessandro: "capicom 1.0 download"
    Date: Thu, 29 Apr 2004 11:45:11 -0400
    
    

    I'm writing a GINA DLL (based on PropCert) to read a cert from a
    smartcard and use it to sign some data. The code works fine when built
    as a console app and run from a command prompt, but fails with "Cannot
    find the certificate and private key for decryption" when run as part
    of the GINA DLL. The certificate is read from the smartcard correctly
    (and I have a valid PCCERT_CONTEXT) but the CryptSignMessage
    call fails (as does a call to CryptAcquireCertificatePrivateKey).

    Based on other postings related to this error, I'm guessing its a
    permissions
    problem of some sort. But since this is not a .NET or ASP program and the
    certificate is always coming from the smartcard (not a user store), the
    other
    postings give no clue as to a solution. I suspect that the association
    between
    the cert and the smartcard has been lost, but don't understand why it would
    work when run as a user app. The problem occurs on both w2k and XP.

    Any clues would be appreciated.

       - Ron


  • Next message: alessandro: "capicom 1.0 download"

    Relevant Pages

    • RE: integrity and mail encryption
      ... PKI Administrator creates a “passcode” that will allow user to download cert from our Managed PKI web interface. ... User agrees to take full responsibility for the safekeeping and protection of the private key associated with this cert. ... User downloads and installs certificate. ... Smartcard / Token, the cert resides on a smartcard which can also be PIN protected. ...
      (Security-Basics)
    • Re: ISA-Server 2004 Problem mit Certs beim VPN-client
      ... Nein benutze kein Radius (noch eins von meinen Problemen hat einfach nit ... und auch kein Smartcard! ... auf dem ISA ist auch IAS installiert und das Cert ... musst Du ein Computerzertifikat auf dem IAS ...
      (microsoft.public.de.german.isaserver)
    • Sign winword documents - CSP
      ... After receiving the certificate from a CA, the cert will be stored on ... the SmartCard too, so we are ... Word 2000 for the signature function. ...
      (microsoft.public.platformsdk.security)
    • Howto identify a ca or root certificate
      ... smartcard and place them in MyStore in order to use them together with a self ... The problem I’am having is to distingue CA or ROOT cert ... Can anybody help me find an easy way to determine if a cert is a root or ca ...
      (microsoft.public.platformsdk.security)
    • Re: CAPICOM doesnt works with SmartCard
      ... but i've to read a cert from a SmartCard... ... > Best Regards, ... > Alon Bar-Lev. ...
      (microsoft.public.platformsdk.security)