Reference

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 typemaxsizesymbolic constant
NID_commonName64ub_common_name
NID_countryName2—
NID_givenName32768ub_name
NID_initials32768ub_name
NID_localityName128ub_locality_name
NID_name32768ub_name
NID_organizationName64ub_organization_name
NID_organizationalUnitName64ub_organization_unit_name
NID_pkcs9_emailAddress128ub_email_address
NID_serialNumber64ub_serial_number
NID_stateOrProvinceName128ub_state_name
NID_surname32768ub_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).