ASN1_STRING_TABLE_GET(3)

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

πŸ’– ASN1_STRING_TABLE_get β€” retrieve an entry from the global ASN.1 string table

okay so bestie, welcome to the ASN1_STRING_TABLE_GET(3) page from the Library Functions Manual β€” it's literally all about grabbing one little entry out of the global ASN.1 string table, and I'm obsessed ✨

🌸 NAME 🌸

ASN1_STRING_TABLE_get β€” retrieve an entry from the global ASN.1 string table

✨ SYNOPSIS ✨

here's the whole "how do I even call this" situation, no cap:

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

ASN1_STRING_TABLE *
ASN1_STRING_TABLE_get(int nid);

πŸ¦‹ DESCRIPTION πŸ¦‹

The ASN.1 string table is a unique global object. Each entry is of the type ASN1_STRING_TABLE and contains information about one NID object. The entries are predefined according to RFC 5280 appendix A.1. 🫢

The upper bounds for the number of characters in various kinds of ASN1_STRING objects are β€” object type β†’ maxsize β†’ symbolic constant, bestie:

  • NID_commonName β€” maxsize 64, symbolic constant ub_common_name
  • NID_countryName β€” maxsize 2, symbolic constant β€”
  • NID_givenName β€” maxsize 32768, symbolic constant ub_name
  • NID_initials β€” maxsize 32768, symbolic constant ub_name
  • NID_localityName β€” maxsize 128, symbolic constant ub_locality_name
  • NID_name β€” maxsize 32768, symbolic constant ub_name
  • NID_organizationName β€” maxsize 64, symbolic constant ub_organization_name
  • NID_organizationalUnitName β€” maxsize 64, symbolic constant ub_organization_unit_name
  • NID_pkcs9_emailAddress β€” maxsize 128, symbolic constant ub_email_address
  • NID_serialNumber β€” maxsize 64, symbolic constant ub_serial_number
  • NID_stateOrProvinceName β€” maxsize 128, symbolic constant ub_state_name
  • NID_surname β€” maxsize 32768, symbolic constant ub_name

The function ASN1_STRING_TABLE_get() retrieves the entry for nid. If the STABLE_NO_MASK flag is set, ASN1_STRING_set_by_NID(3) skips applying the global mask that can be set with ASN1_STRING_set_default_mask(3). πŸ’…

πŸ’« RETURN VALUES πŸ’«

ASN1_STRING_TABLE_get() returns a valid ASN1_STRING_TABLE structure or NULL if nothing is found. that's it, bestie β€” either a whole struct or absolutely nothing 😭

πŸ”₯ SEE ALSO πŸ”₯

go read these next, iykyk 🧚

πŸŽ€ HISTORY πŸŽ€

ASN1_STRING_TABLE_get() first appeared in OpenSSL 0.9.5 and has been available since OpenBSD 2.7. iconic behavior honestly πŸ‘‘

πŸ’€ BUGS πŸ’€

Most aspects of the semantics considerably differ from OpenSSL. 🫠

ub_email_address, which should really be called ub_emailaddress_length, was changed in RFC 5280 from 128 to 255 to match PKCS#9 (RFC 2985). not me side-eyeing that naming choice πŸ™ˆ

mwah πŸ’‹ β€” brought to you by Debian, dated December 31, 2025, for ASN1_STRING_TABLE_GET(3) 🫢

πŸ“¦ where this page comes from