How do I deploy a certificate to the Trusted People store in Azure?

azure, certificate, nettcpbinding, wcf, x509certificate

Solution

I'm just thinking if you can install the CER from your code when your role was started by using `System.Security.Cryptography.X509Certificates.X509Store` and `System.Security.Cryptography.X509Certificates.X509Certificates2`. You can include your CER into your project with "Copy to Output Directory = Copy always".

Problem

How can I get a public key certificate deployed to my Worker Role's `Trusted People` store? I'm using `PeerTrust` for WCF (self-hosted TCP services in Azure): ``` var creds = new ServiceCredentials(); creds.ClientCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.PeerTrust; ``` I know how to reference the certificate both in my `.csdef` and in code. However, I don't know how to take a `.cer` file (with no private key) and actually get it into Azure so it can use it for PeerTrust. The Certificates manager in the online Portal only allow you to upload `.pfx` files (i.e. certificates with the private keys).

Original source

Related problems