I’ve added a digital certificate into the resources for my project. I need the certificate for my FEZ Spider to host an SSL service. The certificate loads into the resources fine and I can see the bytes in debug mode. The error is when I attempt to parse bytes into the certificate object. There is not a message in the exception. I’ve tried it as a pfx file with pfx password and a cer file without a password. What am I missing here?
As a .pfx file:
byte[] b = Resources.GetBytes(Resources.BinaryResources.ResourceName);
X509Certificate cert = new X509Certificate(b, "pfxpassword");
As a .cer file:
byte[] b = Resources.GetBytes(Resources.BinaryResources.ResourceName);
X509Certificate cert = new X509Certificate(b);