by Oleg [BurlachenkoO at mail dot ru] posted on 2005/02/02 |
|
When I call this method on X509Certificate, that have association with private key, created Certificate object doesn't have private key. Why?
Is it possible to create a Certificate object initialized with the private key from certificate store(do not call AssociateWithPrivateKey method)? |
by Pieter Philippaerts [Pieter at mentalis dot org] posted on 2005/03/25 |
|
CreateFromX509Certificate loads a certificate from a .CER file, and .CER files do not contain private keys. If you want to use a filetype that does contain private keys, you should use .PFX.
If you have the certificate and its private key in a certificate store, you should use the CertificateStore class to load it. If you do it like this, your certificate won't lose its connection with the private key. |