Click here to Skip to main content
15,878,959 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I had coded to install certificate on server as under.
C#
private static void InstallCertificate(string cerFileName, string cerPass )
{
    X509Certificate2 certificate ;

      if (String.IsNullOrEmpty(cerPass))
             certificate = new X509Certificate2(filename);
      else
          certificate =   new X509Certificate2(cerFileName,cerPass);

    X509Store store = new X509Store(StoreName.TrustedPublisher, StoreLocation.LocalMachine);

    store.Open(OpenFlags.ReadWrite);
    store.Add(certificate);
    store.Close();
}

this code fails when I have certificate with password I can install the certificate in my local pc with the same password what to do in this case?

Error Invalid Access when certificate with password is passed.
Posted
Updated 18-Aug-14 18:52pm
v2
Comments
OriginalGriff 18-Aug-14 9:53am    
You don't have to repost to make a change to your question: just use the "Improve question" widget.
I've deleted the older version.
ZurdoDev 18-Aug-14 11:01am    
What is the error?
sunny1787 19-Aug-14 0:53am    
Error Invalid Access when certificate with password is passed.
Gihan Liyanage 18-Aug-14 12:36pm    
Cant you use makecert for this ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900