X509(7ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… X509 β€” the OpenSSL manual, but make it make sense

okay so bestie, welcome to X509(7ossl) β€” the OpenSSL page for X.509 certificate handling. yes, the whole certificate saga. grab a boba, we're gonna get into it ✨


✨ NAME ✨

x509 β€” X.509 certificate handling πŸŽ€


🌸 SYNOPSIS 🌸

#include <openssl/x509.h>

that's it. that's the whole synopsis. one include and you're in. iconic.


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: an X.509 certificate is a structured grouping of information about an individual, a device, or literally anything one can imagine πŸ’«. like, anything. a person, a server, your weird little printer β€” the cert doesn't judge.

an X.509 CRL (that's a certificate revocation list, iykyk) is a tool to help determine if a certificate is still valid. so when a cert gets cancelled, this is the list that says so πŸ’€.

the exact definition of those can be found in the X.509 document from ITU-T, or in RFC3280 from PKIX. in OpenSSL, the type X509 is used to express such a certificate, and the type X509_CRL is used to express a CRL. slay, naming consistency 🀝


a related structure is a certificate request, defined in PKCS#10 from RSA Security, Inc, also reflected in RFC2896. in OpenSSL, the type X509_REQ is used to express such a certificate request. it's giving "please sign me" energy πŸ™ˆ


πŸ’œ the complex bits

to handle some complex parts of a certificate, there are the types X509_NAME (to express a certificate name), X509_ATTRIBUTE (to express a certificate attribute), X509_EXTENSION (to express a certificate extension) and a few more. the "a few more" is doing a LOT of heavy lifting there but okay, we move πŸ’…

and finally β€” the main character β€” there's the supertype X509_INFO, which can contain a CRL, a certificate and a corresponding private key. all three. one struct. obsessed πŸ”₯


⭐ which functions do what

okay this part is lowkey the important bit, so pay attention bestie:

  • X509_XXX, d2i_X509_XXX, and i2d_X509_XXX functions handle X.509 certificates, with some exceptions, shown below.
  • X509_CRL_XXX, d2i_X509_CRL_XXX, and i2d_X509_CRL_XXX functions handle X.509 CRLs.
  • X509_REQ_XXX, d2i_X509_REQ_XXX, and i2d_X509_REQ_XXX functions handle PKCS#10 certificate requests.
  • X509_NAME_XXX functions handle certificate names.
  • X509_ATTRIBUTE_XXX functions handle certificate attributes.
  • X509_EXTENSION_XXX functions handle certificate extensions.

not the _XXX suffixes being literally every function 😭 but fr fr, that's the convention and it ate.

heads up: the certificate line says "with some exceptions, shown below" β€” so don't assume every single X509_XXX is a cert function, okay? check the list πŸ‘‘

🌈 SEE ALSO 🌈

the full reading list πŸ’– go off, read them all, you'll be so smart.


Copyright 2003-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


aaaaand that's the page!! 🫢✨ this was X509(7ossl) from OpenSSL, version 3.5.0, dated 2026-09-25 β€” go forth and handle those certificates, bestie, you've got this πŸ“πŸ’œ

πŸ“¦ where this page comes from