Technical Info

Viewing .crt and .pem certificate files & elliptic curve technology

Usually interacting with a web site certificate requires clicking through the certificate tabs and fields that can be slow. This article describes how to export the certificate and view the .crt or .pem file.

supportmicrosoftcom

Click ‘Export’ to download the .crt and .pem files from the web site. In our example we have used one from Microsoft:

https://support.microsoft.com

The CertUtil is built into MS Windows and is available at the command prompt. From the MS Windows start menu launch “cmd” to get a command prompt and type the following:

C:\>certutil supportmicrosoftcom.crt > supportmicrosoftcom.txt

View the text file and it looks like this:

X509 Certificate:
Version: 3
Serial Number: 200002287cdc13c03ed292a74300000002287c
Signature Algorithm:
Algorithm ObjectId: 1.2.840.113549.1.1.11 sha256RSA
Algorithm Parameters:
05 00
Issuer:
CN=Microsoft IT TLS CA 2
OU=Microsoft IT
O=Microsoft Corporation
L=Redmond
S=Washington
C=US
Name Hash(sha1): 881a4a74feff4652f354bb510fd3a4eeefe0a1c8
Name Hash(md5): 310cd0eb139f28ab9f55bce673112357

NotBefore: 28/02/2018 10:56 AM
NotAfter: 28/02/2020 10:56 AM

This pipes the output into a text file. It can be useful to view the anatomy of the Microsoft certificate, including:

  • Certicate valid from / to dates.
  • Certificate authority that issued the certificate.
  • Whether it is a wildcard certificate for *.sanitysecurity.com or just for http://www.sanitysecurity.com
  • Public key algorithm is RSA.
  • Public key length is 2048 bits.

We can compare the Microsoft certificate with a certificate from Google for Gmail:

https://mail.google.com

Again, we perform the same command using CertUtil to output the contents:

C:>certutil google-mail.cer > google-mail.txt

We notice the following differences:

  • Public key algorithm is ECC using ECDSA_P256.
  • Public key length is 256 bits.

We can take guidance on key algorithms and key length from NIST in the NIST Special Publication 800-57 Part 3: Recommendation for Key Management. The publication contains the table below that indicates the comparable key lengths for the different key lengths.

Key Type Algorithms and Key Sizes
Digital Signature keys used for
authentication (for Users or Devices)
RSA (2048 bits)
ECDSA (Curve P-256)
Digital Signature keys used for
non-repudiation (for Users or Devices)
RSA (2048 bits)
ECDSA (Curves P-256 or P-384)
CA and OCSP Responder
Signing Keys
RSA (2048 or 3072bits)
ECDSA (Curves P-256 or P-384)
Key Establishment keys
(for Users or Devices)
RSA (2048 bits)
Diffie-Hellman (2048 bits)
ECDH (Curves P-256 or P-384)

Unfortunately, since the disclosures from Edward Snowden on the activities of the NSA there have been some discussion regarding whether Elliptic Curve algorithms can be trusted. The issue is about the source of the seed number that the Elliptic Curve algorithms rely upon. Some background information on elliptic curve technology can be found below. As is often the case with cryptography, the strength of the protection relies upon the encryption algorithm and how it is used.

We hope this helps, @SanitySecurity

Standard