---
name: "libressl-X509V3_EXT_get_nid"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-X509V3_EXT_get_nid"
---

# libressl-X509V3\_EXT\_get\_nid(3)

retrieve X.509v3 certificate extension methods

## NAME

**X509V3\_EXT\_get\_nid**, **X509V3\_EXT\_get** – retrieve X.509v3 certificate extension methods

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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

An X.509v3 certificate extension 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. 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).

## RETURN VALUES

**X509V3\_EXT\_get\_nid**() returns the *X509V3\_EXT\_METHOD* corresponding to the numeric identifier *nid*, or NULL if there is none.

**X509V3\_EXT\_get**() returns the *X509V3\_EXT\_METHOD* associated with the extension type of *ext*, or NULL if there is none.

## 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.

## CAVEATS

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.
