ASN1_STRING_TABLE_GET(3)

NAME
ASN1_STRING_TABLE_get - retrieve an entry from the global ASN.1 string table

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