Associate a private key (container) with the certificate?

From: Antonio Ruiz Martínez (arm_at_dif.um.es)
Date: 02/24/04


Date: Tue, 24 Feb 2004 18:53:26 +0100

Hello all!

    I'm writing, with my own code and using the CryptoApi, the request
of a certificate (PKCS#10) and I have a big problem that I don't know
how I can solve (if it is possible I don't like using the enroll
activex).
Now I'm going to tell you what I'm doing and which it is my problem:
- I'm doing the request. In order to do it I generate a private key in a
new container with CryptAcquireContext using the Microsoft Base
Provider. Then I'm working with it to do the PKCS#10 request. Similar to
the process of the enroll.
- After I send my request to the Certificate Authority.
- The following day I get the certificate.
The problem is that I don't know how I can associate the certificate
with the container because when I receive the certificate I don't know
how I can get the name of the container where the private key was
generated. Is there function of the Cryptoapi to know it?

I have seen there is a function called CertCreateCertificateContext to
do the association it but it requires the name of the container.
What are the steps I should follow? Could you guide me, please?

Thanks in advance,
Regards,
Antonio.



Relevant Pages

  • Re: IIS 6.0 SSL Certificate Difficulties
    ... that is just a plain text file with encrypted detail of your server detail. ... do you export the private key as well? ... > certificate from the IIS Snap-in it says that "You have a private key that ... > Another symptom is that when we create the request on the 2003 server, ...
    (microsoft.public.inetserver.iis)
  • RE: SIMple SSL question ??
    ... OK - i would also delete a cert request file lying around. ... But a certificate is a pub key + extra info. ... That said - if someone compromises the server he will also find a way to retrieve the private key. ... traffic between the initial web server and the client. ...
    (microsoft.public.dotnet.security)
  • Re: Problems enabling SSL on AD
    ... Something got hosed between the request for the certificate and the actual ... You probably have the private key on your machine somewhere ... so Windows doesn't know that the cert ...
    (microsoft.public.windows.server.active_directory)
  • Re: Client Certificate not reaching server
    ... being sent in the actual request. ... I do have a private key installed. ... certificate is in the Local Computer/Personal store on the client machine. ...
    (microsoft.public.dotnet.security)
  • Re: iis 6 on win 2003
    ... How do you export the private key? ... > i have to install a certificate on a server in production. ... > I can create a certificate request. ...
    (microsoft.public.inetserver.iis.security)