X509_INFO_NEW(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸŽ€ NAME πŸŽ€

okay so this page is X509_INFO_NEW(3) from the Library Functions Manual, and it's giving β€œX.509 certificate wrapper object” energy ✨. The actual stars are X509_INFO_new and X509_INFO_free, and they are lowkey iconic for handling cert wrapper stuff.


✨ SYNOPSIS ✨

library β€œlibcrypto” #include <openssl/x509.h>

X509_INFO *
X509_INFO_new(void);

void
X509_INFO_free(X509_INFO *info);

πŸ’– DESCRIPTION πŸ’–

So X509_INFO is this reference-counted wrapper object, right? It stores a pointer to an X.509 certificate together with pointers to the associated private key and to an associated certificate revocation list. Like it's carrying the cert, the key, and the CRL all in one little bag πŸ‘œ. It is for example used internally by X509_load_cert_crl_file(3).

  • X509_INFO_new() β€” allocates and initializes an empty X509_INFO object and sets its reference count to 1. Fresh out the box, refcount one, main character energy πŸ‘‘.
  • X509_INFO_free() β€” decrements the reference count of info by 1. If the reference count reaches 0, it frees all referenced objects as well as the storage needed for info itself. And if info is a NULL pointer, no action occurs β€” literally nothing happens, we simply do not engage πŸ’….

🌈 RETURN VALUES 🌈

X509_INFO_new() returns the newly allocated X509_INFO object, or NULL if an error occurs. That's the whole vibe check: object or NULL, no in-between 🫢.


πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, bestie, they're in the same friend group πŸ’œ


⭐ HISTORY ⭐

X509_INFO_new() and X509_INFO_free() first appeared in SSLeay 0.5.1 and have been available since OpenBSD 2.4. ancient lore, but honestly kind of iconic 🧚.


mwah πŸ’‹ β€” this cutie came from Debian, dated July 16, 2025. periodt. πŸ“

πŸ“¦ where this page comes from