CryptImportKey fails

From: Hector (HEPETI_at_yahoo.es)
Date: 11/05/04

  • Next message: lelteto: "RE: CryptImportKey fails"
    Date: 5 Nov 2004 02:39:41 -0800
    
    

    Hi everybody,

    I'm developing my own Smart Card CSP. I don't have crypto smart cards,
    so I have to load private key into my CSP from my Scard for signing
    working (which I do with Microsoft Base Provider).Indeed, when I call
    CryptSignHash, my CSP is loading adn importing my private key
    internally, and after the sign is done with the Base Provider.

    CryptImportKey fails only in this case: For example, after calling
    CryptAcquireContext and doing hash functions (CreateHash,HashData), I
    can get my sign without any problem. After doing it, I release the
    context and I delete everything (key container, hash...) But, if I
    repeat the same process just after releasing the context
    (CryptAcquireContext,Hash functions and finally CryptSignHash),
    CryptImportKey function fails with NTE_BAD_VERSION error.

    What's more, if I call CryptImportKey function more times with the
    same context, it works fine.

    Any help would be appreciated,

    Regards
    Héctor Pérez Tijero - University of Cantabria


  • Next message: lelteto: "RE: CryptImportKey fails"

    Relevant Pages

    • Re: CAs Key on Smart Card Problem
      ... As far as I know Microsoft is using HSMs for storing the root CA keys. ... advanced CSP may indeed be required. ... >> store the CA's private Key on a Smart Card. ...
      (microsoft.public.windows.server.security)
    • CAs Key on Smart Card Problem
      ... store the CA's private Key on a Smart Card. ... installation process of the certificate services I ... checkbox "Allow this CSP to interact with the desktop". ...
      (microsoft.public.windows.server.security)
    • Re: CAs Key on Smart Card Problem
      ... so it is no problem that the smart card ... integrated) GemPlus csp with the 8k GemPlus card. ... >- needing to access the CA's private key ...
      (microsoft.public.windows.server.security)
    • Re: Alternative store vs. MY store
      ... store both the client cert and its associate private key on my USB memory ... your codes (CSP, ... indirect call to your CSP when one of your cert is involved in an operation. ...
      (microsoft.public.platformsdk.security)
    • Re: Alternative store vs. MY store
      ... >> keep the private key on the memory card all the time. ... > must so start to copy your certs to the store, ... > indirect call to your CSP when one of your cert is involved in an operation. ...
      (microsoft.public.platformsdk.security)