GENERAL_NAME_NEW(3)
π GENERAL_NAME_NEW(3) β names for use in X.509 extensions π
okay so bestie, this is the GENERAL_NAME_NEW(3) page from the libcrypto library manual β yes, that libcrypto, the OpenSSL one β and it's literally all about the name structures you use inside X.509 extensions. buckle up, it's actually cute once you get it π
β¨ SYNOPSIS β¨
link against the βlibcryptoβ library and pull in the header like this:
#include <openssl/x509v3.h>
then you've got these four little constructor/destructor pairs, and honestly they're all the same shape:
GENERAL_NAME *
GENERAL_NAME_new(void);
void
GENERAL_NAME_free(GENERAL_NAME *name);
GENERAL_NAMES *
GENERAL_NAMES_new(void);
void
GENERAL_NAMES_free(GENERAL_NAMES *names);
EDIPARTYNAME *
EDIPARTYNAME_new(void);
void
EDIPARTYNAME_free(EDIPARTYNAME *name);
OTHERNAME *
OTHERNAME_new(void);
void
OTHERNAME_free(OTHERNAME *name);
see? same energy every time. make one, free one. slay π
πΈ DESCRIPTION πΈ
okay so here's the lore. there's this thing called an X.501 Name (documented over in X509_NAME_new(3)), and it is a lot β a whole complicated multi-layered structure. but here's the tea: even though it's huge and elaborate, it's also super rigid, and it's just not flexible enough to represent all the various entities people want to use as names in certificates π
so for that reason, X.509 extensions use the X.509 GeneralName wrapper structure instead of using the X.501 Name structure directly β and yeah, that costs you one or two additional layers of indirection, but honestly? worth it. main character tradeoff.
π« GENERAL_NAME_new() allocates and initializes an empty GENERAL_NAME object, representing the ASN.1 GeneralName structure defined in RFC 5280 section 4.2.1.6. it can for example hold an X509_name object, an IP address, a DNS host name, a uniform resource identifier, an email address, or an EDIPARTYNAME or OTHERNAME object described below. GENERAL_NAME_free() frees name.
π« GENERAL_NAMES_new() allocates and initializes an empty GENERAL_NAMES object, which is a STACK_OF(GENERAL_NAME) and represents the ASN.1 GeneralNames structure defined in RFC 5280 section 4.2.1.6. it's used by extension structures that can contain multiple names β for example key identifier, alternative name, and distribution point extensions. GENERAL_NAMES_free() frees names.
π« EDIPARTYNAME_new() allocates and initializes an empty EDIPARTYNAME object, representing the ASN.1 EDIPartyName structure defined in RFC 5280 section 4.2.1.6, where βEDIβ stands for βelectronic data identifierβ. it can hold two strings: the name itself, and the name of the authority that assigned that name. EDIPARTYNAME_free() frees name.
π« OTHERNAME_new() allocates and initializes an empty OTHERNAME object, representing the ASN.1 OtherName structure defined in RFC 5280 section 4.2.1.6. it can hold data of any ASN1_TYPE together with a type identifier. OTHERNAME_free() frees name.
π¦ RETURN VALUES π¦
GENERAL_NAME_new(), GENERAL_NAMES_new(), EDIPARTYNAME_new(), and OTHERNAME_new() return a new GENERAL_NAME, GENERAL_NAMES, EDIPARTYNAME, or OTHERNAME object β or NULL if an error occurs π
ngl, always check for that NULL, bestie. it's giving "i forgot to vibe check the return value" and that's not the move π
π SEE ALSO π
π STANDARDS π
RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2: Certificate Extensions β¨
π HISTORY π
the timeline, periodt:
GENERAL_NAME_new(),GENERAL_NAME_free(),GENERAL_NAMES_new(), andGENERAL_NAMES_free()first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6.OTHERNAME_new()andOTHERNAME_free()first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.EDIPARTYNAME_new()andEDIPARTYNAME_free()first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.
like, they've been iconic since before some of us were born fr fr π«Ά
aaaand that's the whole page, bestie π this one's the Debian build, dated June 8, 2025, filed under GENERAL_NAME_NEW(3) β go forth and name things responsibly ππ§
π¦ 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) 2016 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