Summery

A certificate is a digitally signed document that connects an identity to a public key. Certificates are commonly used for HTTPS, authentication, VPNs, smart cards, and Active Directory Certificate Services (ADCS).

The important distinction is:

  • Private key - Secret cryptographic material used to prove ownership
  • Public key - Derived from the private key and safe to share with others
  • Certificate - Contains the public key, identity information, and a trusted CA’s signature

The certificate essentially says “This public key belongs to this identity.”

Certificates can reveal useful information:

  • User/computer identities
  • Hostnames and domains
  • Certificate authorities
  • Certificate templates
  • Authentication purposes
  • AD CS configuration

A Certificate Authority (CA) signs the certificate so others can verify that claim.
AD CS attacks, a major goal can be obtaining a certificate that allows authentication as another account.

Certificates vs Keys

A certificate is not a key.

For example, a server might have:
server.key contains the private key and must remain secret.
server.crt contains the public key and information such as the server’s identity, issuer, validity period, and usage restrictions.

Common Formats

Certificates:

.crt
.cer
.pem # .pem does not necessarily mean "certificate" - PEM is an encoding format that can contain certificates, private keys, CSRs, and other objects.

Certificate + private key bundles:

.pfx
.p12

Useful Commands

Inspect a certificate:

openssl x509 -in certificate.crt -text -noout

Inspect a PFX:

openssl pkcs12 -in certificate.pfx -info

References

Connected: Active Directory Certificate Services (ADCS), Certipy