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
ASN1_STRING_TABLE_add() returns 1 on success or 0 if an error occurred.

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

SEE ALSO
ASN1_OBJECT_new(3), ERR_get_error(3), OBJ_nid2obj(3)

BUGS
Most aspects of the semantics considerably differ from OpenSSL.