X509V3_EXT_GET_NID(3)
π X509V3_EXT_GET_NID(3) β bestie, letβs retrieve those extension methods
Okay so this is the X509V3_EXT_GET_NID(3) page from the Library Functions Manual, and itβs here to explain how we retrieve X.509v3 certificate extension methods. Itβs giving βlookup by number or by actual extensionβ energy, and honestly? Kinda iconic. π
β¨ NAME β¨
X509V3_EXT_get_nid,X509V3_EXT_getβ retrieve X.509v3 certificate extension methods.
πΈ SYNOPSIS πΈ
library βlibcryptoβ
#include <openssl/x509v3.h>
const X509V3_EXT_METHOD *
X509V3_EXT_get_nid(int nid);
const X509V3_EXT_METHOD *
X509V3_EXT_get(X509_EXTENSION *ext);
π¦ DESCRIPTION π¦
Okay so picture an X.509v3 certificate extension. It contains an Object Identifier (OID), a boolean criticality indicator, and an opaque extension value β an ASN1_OCTET_STRING β whose meaning is determined by the OID. Thatβs the whole trio, bestie. π
The libraryβs X509V3_EXT_METHOD type, which is not yet documented in detail, contains a numeric identifier (NID) to represent the OID and various handlers for encoding, decoding, printing, and configuring the extensionβs value. Criticality is handled separately, for example as an argument to X509V3_add1_i2d(3). Periodt. β¨
π RETURN VALUES π
X509V3_EXT_get_nid()returns theX509V3_EXT_METHODcorresponding to the numeric identifiernid, orNULLif there is none.X509V3_EXT_get()returns theX509V3_EXT_METHODassociated with the extension type ofext, orNULLif there is none.
No match? You get NULL, bestie. Itβs not ghosting you on purpose. π
π SEE ALSO π
i2s_ASN1_ENUMERATED_TABLE(3)OBJ_create(3)v2i_ASN1_BIT_STRING(3)X509_EXTENSION_get_object(3)X509V3_get_d2i(3)
π STANDARDS π
- RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
section 4.2: Certificate Extensions
β³ HISTORY β³
These functions first appeared in OpenSSL 0.9.2b and have been available since OpenBSD 2.6. Vintage behavior, but make it useful. π
π CAVEATS π
Okay bestie, important stuff β donβt skip this part:
In LibreSSL, these functions only support built-in nid values corresponding to static built-in objects. Other implementations have incomplete support for custom extension methods, whose API is not threadsafe, does not affect the behavior of X509_verify_cert(3), and has various other surprising quirks. Both functions prefer built-in methods over custom methods with the same OID. π«Ά
This page came from Debian, dated June 8, 2025 β mwah π
π¦ 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) 2024 Theo Buehler <tb@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms