X509_NAME_NEW(3)

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

πŸ’… X509_NAME_NEW β€” X.501 Name object

Okay bestie, so this one lives in the Library Functions Manual (yes, the libcrypto girlies, we're back at it again) and it's all about the X509_NAME glow-up: creating one, and freeing one. Let's get into it πŸŽ€


✨ SYNOPSIS ✨

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

X509_NAME *
X509_NAME_new(void);

void
X509_NAME_free(X509_NAME *name);

🌸 DESCRIPTION 🌸

So picture this: an X.501 Name is literally just an ordered sequence of relative distinguished names. And a relative distinguished name? It's a set of key-value pairs β€” like the most organized little group chat ever. See X509_NAME_ENTRY_new(3) for the deets on those πŸ’–

Various X.509 structures have X.501 Name substructures living inside them. Where at? For example: the issuers of certificates and certificate revocation lists, and the subjects of certificates and certificate requests. So like, everywhere. Main character energy honestly πŸ‘‘

X509_NAME_new() allocates and initializes an empty X509_NAME object, which represents an ASN.1 Name structure defined in RFC 5280 section 4.1.2.4. Think of it as a fresh new empty profile page ✨ You can add data to these objects with the functions described in X509_NAME_add_entry_by_txt(3), and you can inspect them with the functions described in X509_NAME_get_index_by_NID(3). So cute, so useful πŸ¦‹

X509_NAME_free() frees name and all the X509_NAME_ENTRY objects contained in it. Like, every single one, no leftovers πŸ™ˆ And if name is a NULL pointer, no action occurs β€” nothing happens, we simply move on, periodt πŸ’…


🫢 RETURN VALUES 🫢

X509_NAME_new() returns a new X509_NAME object, or NULL if an error occurred. So always check, bestie β€” NULL is the vibe check failing 😭


πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ STANDARDS πŸ‘‘

  • RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
  • ITU-T Recommendation X.501, also known as ISO/IEC 9594-2: Information Technology – Open Systems Interconnection – The Directory: Models, section 9: Names

🧚 HISTORY 🧚

X509_NAME_new() and X509_NAME_free() appeared in SSLeay 0.4 or earlier β€” like, ancient. Iconic longevity honestly. And they've been available since OpenBSD 2.4. Fr fr, elder statesmen of the crypto world ⭐


and that's the whole page, bestie β€” go forth and name things πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

This one came to you from Debian, dated June 8, 2025 β€” X509_NAME_NEW(3), signing off πŸ“πŸ’œ

πŸ“¦ where this page comes from