I'm currently working on a wcf server and would like to load my certificate from a file/resource instead of the certificate store to make deployment easier. Any ideas how to do this?
Thanks for your help!
I'm currently working on a wcf server and would like to load my certificate from a file/resource instead of the certificate store to make deployment easier. Any ideas how to do this?
Thanks for your help!
The following SO question has a detailed code sample of how to do this, however this may not work where the certificates are password-protected.
Programmatic WCF Message Security with Certificates
Suppose you are using duplex channel,you can load certificate from file as the following:
In your client's code, load the certificate as same as above
I think you should be okay from this point. Just remember that if you load from a file, you have to load the .pfx file which is generated by pvk2pfx.exe , it has both private key and public key. Otherwise WCF will get confused to where to lookup for private key.
I think this is what you are looking for: http://www.codeproject.com/KB/WCF/wcfcertificates.aspx