Decode PEM Encoded SSL Certificate

Objective: Decode a PAM encoded SSL certificate and verify that it contains the correct information.

A PEM encoded certificate is a block of encoded text that contains all of the certificate information and public key. A PEM file will contain ASCII data in BASE64 format that should start with “—–BEGIN CERTIFICATE—– ” and end with “—–END CERTIFICATE—– “. To decode the file, we will need to use the openssl utility.

So, if the cert name is cert.pem, we will need to run openssl like this.

Once decoded, you can view all the certificate information like the signature algorithm, validity dates, key length, domain names, etc.

If the SSL certificate is corrupted, then you may get an error similar to the one below.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }