Browsed by
Tag: Certificates

.NET CryptographicException “Keyset does not exist”

.NET CryptographicException “Keyset does not exist”

Came across this error today when updating a new certificate used in a WCF service for digital signatures. Turns out the solution, as always, was pretty simple: give correct permissions to the private key file. Open the certificate manager and locate the correct certificate. Right click and navigate to: All Tasks -> Manage Private Keys. Change the file permissions so the IIS user can read. Read more on stackoverflow.com.

OpenSSL create certificate request

OpenSSL create certificate request

Execute this command from a terminal/command window to generate a new private key and a new certificate signing request (csr). openssl req -new -newkey rsa:4096 -nodes -keyout yourdomain.key -out yourdomain.csr -sha256 It will ask you some questions Country Name (2 letter code) [AU]:BE State or Province Name (full name) [Some-State]: Antwerpen Locality Name (eg, city) []: Antwerpen Organization Name (eg, company) [Internet Widgits Pty Ltd]: My Company Name Organizational Unit Name (eg, section) []: Department X Common Name (e.g. server…

Read More Read More

Keyset does not exist error in .NET application

Keyset does not exist error in .NET application

When using WCF to communicate with a web service that required a client certificate, I couldn’t get the solution to run unless I started Visual Studio as an administrator. The error that I got was : System.Security.Cryptography.CryptographicException Keyset does not exist I knew full well the private key did exist (you can see this in MMC > Certificates). So it had to be a security related issue, seeing that when I run it as admin I have no issues. After…

Read More Read More

Certificate chain error fix on Linux

Certificate chain error fix on Linux

When checking your certificate on a site like the one from digicert. I’m often confronted with the following error: This means that your certificate doesn’t contain the full certification path (and that some parts can’t even be found in the default trusted authority store). To fix this error on a linux PC, navigate to your directory where you saved your .crt file and make sure you also have the other .crt files, that make up the chain, present there. Next…

Read More Read More

Optimize SSL settings in Windows Server 2008

Optimize SSL settings in Windows Server 2008

SSL labs provides, through it’s website, a thorough free testing of an https enabled site. It has different rankings based on the (American) school grading system, where F is the lowest score and A++ the highest. Numerical Score Grade score >= 80 A score >= 65 B score >= 50 C score >= 35 D score >= 20 E score < 20 F In this post I will try and go through the steps to achieve an “A” rating for…

Read More Read More

Create certificate request with SHA256 on IIS 7

Create certificate request with SHA256 on IIS 7

Creating a CSR (or Certificate Singing Request) on an IIS 7 is pretty straight forward, but you end up with a request which uses the old SHA1 hashing method. Your certificate request will work, but the end result will be that your site might be vulnerable to SSL/TLS related attacks. So how to create a CSR that uses the SHA256 algorithm? All the information bellow can be found on ServerFault. First make a request.inf file. (Just use a text editor…

Read More Read More