Question : WCF Problem: The private key is not present in the X.509 certificate.

I am attempting to use a webservice which is secured using certificates, I have installed the certificate and sent them mine.

When I try access any of the service methods with my client app I get the following error:

"The private key is not present in the X.509 certificate."

I have not done this sort of thing before. Do I need to set the key somehow in the object?

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
smartClient = new SmartloadClient("SmartloadPort");            

            smartClient.ClientCredentials.ClientCertificate.SetCertificate(
                                                                StoreLocation.CurrentUser,
                                                                StoreName.TrustedPeople,
                                                                X509FindType.FindBySubjectName,
                                                                "27848803383");                        


            smartClient.ClientCredentials.ServiceCertificate.SetDefaultCertificate ( StoreLocation.CurrentUser,
                                                                StoreName.TrustedPeople,
                                                                X509FindType.FindBySubjectName,
                                                                "SmartCallServices");         

Answer : WCF Problem: The private key is not present in the X.509 certificate.

Turns out I needed to combine the certificate with the key file and then install the resulting pfx file.

openssl pkcs12 -in a.crt -inkey a.key -export -out a.pfx

Thanks for the assistance.
Random Solutions  
 
programming4us programming4us