So, let's talk about certificates.
In our ongoing series on security fundamentals, we have discussed the need to verify the identity of someone’s primary key.
In discussing public and private keys, you recall that we showed that a message encrypted with a user’s public key and associated with a message digest results in a ‘tamperproof’ – or digitally signed document that cannot be altered by any third party. Certificates are an example of such a document. They are intended to ‘prove’ certain claims about a user or entity.
Normally, the most important claim about a user is that their public key is a specific key. Because the issuer of the certificate is implicitly trusted, by following the ‘chain of trust’, a third party can independently verify the identity and public key of another entity. In the discussion that follows, I have kept things simple – but be aware that certificate and certificate management can be a complex topic, so this is only a quick introduction.
Certificates and certificate stores
It is common to store multiple certificates in a certificate store on a computer. There is no requirement that there be a specific single certificate store – and in fact, there are often multiple stores.
For example, on Windows, there is a built-in certificate store. You access this store using either the certmgr.msc utility, to view certificates associated with the current user, or, more generally, by running the mmc.exe utility and then adding the certificate snapin. This option allows you to choose between viewing the certificates associated with the current user or the certificates associated with the local computer account. These certificates are intended to be shared by all users who log on to that machine.
However, the Windows certificate store is just a convenience. Some software on Windows does not use the Windows cert store. For example, although the Chrome, Edge and Internet Explorer browsers use the Windows Store, Firefox has its own certificate store.
Java applications use an associated utility to manage certificates in so-called key stores which exist as normal files.
You can see therefore that certificates can be scattered around in multiple locations.
Anatomy of a certificate
The exact content of a certificate varies depending on the purpose of the certificate. Let’s take a closer look at a certificate inside the Windows cert store.
We’ll start by looking at all the user certificates in the Trusted Root Certificate location in the store. Trusted Root Certificates are those certificates whose issuer's we implicitly trust. We can add any certificate to this list or remove one if we want.
You can see here that there are some key fields.
Issued to indicates the ‘subject’ of the certificate – you can see that in most cases this is the same entity, or a similar entity, to the entity who issued the certificate (i.e., the issued by field).
Expiration date. This is when the certificate ceases to be valid. Note that certificates expire without warning and this has led to many a production system going down unexpectedly. You should proactively manage certificate lifetimes to avoid this.
Intended purposes. One or more purposes for which the certificate is valid. You can see here that purposes can include validating a server or client name, or code signing (i.e., allowing you to use this certificate to stamp your identity on software that you create), and so on.