X509_INFO_NEW(3)
π 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 emptyX509_INFOobject and sets its reference count to1. Fresh out the box, refcount one, main character energy π.X509_INFO_free()β decrements the reference count of info by1. If the reference count reaches0, it frees all referenced objects as well as the storage needed for info itself. And if info is aNULLpointer, 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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms