---
name: "libressl-ASN1_STRING_TABLE_get"
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-ASN1_STRING_TABLE_get"
---

# libressl-ASN1\_STRING\_TABLE\_get(3)

retrieve an entry from the global ASN.1 string table

## NAME

**ASN1\_STRING\_TABLE\_get** – retrieve an entry from the global ASN.1 string table

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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 |
| NID\_commonName | 64 | ub\_common\_name |
| NID\_countryName | 2 | — |
| NID\_givenName | 32768 | ub\_name |
| NID\_initials | 32768 | ub\_name |
| NID\_localityName | 128 | ub\_locality\_name |
| NID\_name | 32768 | ub\_name |
| NID\_organizationName | 64 | ub\_organization\_name |
| NID\_organizationalUnitName | 64 | ub\_organization\_unit\_name |
| NID\_pkcs9\_emailAddress | 128 | ub\_email\_address |
| NID\_serialNumber | 64 | ub\_serial\_number |
| NID\_stateOrProvinceName | 128 | ub\_state\_name |
| NID\_surname | 32768 | 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.

## SEE ALSO

ASN1\_OBJECT\_new(3), ASN1\_STRING\_set\_by\_NID(3), OBJ\_create(3), OBJ\_nid2obj(3)

## HISTORY

**ASN1\_STRING\_TABLE\_get**() first appeared in OpenSSL 0.9.5 and has been available since OpenBSD 2.7.

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