ASN1_STRING_TABLE_ADD(3)

NAME
ASN1_STRING_TABLE_add, ASN1_STRING_TABLE_get, ASN1_STRING_TABLE_cleanup - maintain the global ASN.1 string table

SYNOPSIS
#include <openssl/asn1.h>
int
ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize, unsigned long mask, unsigned long flags);
ASN1_STRING_TABLE *
ASN1_STRING_TABLE_get(int nid);
void
ASN1_STRING_TABLE_cleanup(void);

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. Some entries are predefined according to RFC 3280 appendix A.1.

The function ASN1_STRING_TABLE_add() changes the existing entry for nid or, if there is none, allocates a new entry. Each field of the entry is modified according to the function argument of the same name. The minsize and maxsize arguments overwrite the existing fields unless they are -1. The mask argument always overwrites the existing field. The bits set in the flags argument are OR'ed into the existing field. No useful flags are currently defined, so passing 0 is recommended.

The function ASN1_STRING_TABLE_get() retrieves the entry for nid.

The function ASN1_STRING_TABLE_cleanup() removes and frees all entries except the predefined ones.

RETURN VALUES
The ASN1_STRING_TABLE_add() function returns 1 if successful; otherwise 0 is returned and an error code can be retrieved with ERR_get_error(3).

ASN1_STRING_TABLE_get() returns a valid ASN1_STRING_TABLE structure or NULL if nothing is found.

SEE ALSO
ASN1_OBJECT_new(3), OBJ_nid2obj(3)

HISTORY
ASN1_STRING_TABLE_add(), ASN1_STRING_TABLE_get(), and ASN1_STRING_TABLE_cleanup() first appeared in OpenSSL 0.9.5 and have been available since OpenBSD 2.7.

BUGS
Most aspects of the semantics considerably differ from OpenSSL.