---
name: "ASN1_STRING_TABLE_add"
section: "3ssl"
platform: "linux"
package: "openssl"
version: "3.6.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ASN1_STRING_TABLE_add"
---

# ASN1\_STRING\_TABLE\_add(3ssl)

ASN1\_STRING\_TABLE manipulation functions

## NAME

ASN1\_STRING\_TABLE, ASN1\_STRING\_TABLE\_add, ASN1\_STRING\_TABLE\_get, ASN1\_STRING\_TABLE\_cleanup - ASN1\_STRING\_TABLE manipulation functions

## SYNOPSIS

```
 #include <openssl/asn1.h>
 typedef struct asn1_string_table_st ASN1_STRING_TABLE;
 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

### Types

**ASN1\_STRING\_TABLE** is a table which holds string information (basically minimum size, maximum size, type and etc) for a NID object.

### Functions

**ASN1\_STRING\_TABLE\_add()** adds a new **ASN1\_STRING\_TABLE** item into the local ASN1 string table based on the *nid* along with other parameters.

If the item is already in the table, fields of **ASN1\_STRING\_TABLE** are updated (depending on the values of those parameters, e.g., *minsize* and *maxsize* \>= 0, *mask* and *flags* != 0). If the *nid* is standard, a copy of the standard **ASN1\_STRING\_TABLE** is created and updated with other parameters.

**ASN1\_STRING\_TABLE\_get()** searches for an **ASN1\_STRING\_TABLE** item based on *nid*. It will search the local table first, then the standard one.

**ASN1\_STRING\_TABLE\_cleanup()** frees all **ASN1\_STRING\_TABLE** items added by **ASN1\_STRING\_TABLE\_add()**.

## RETURN VALUES

**ASN1\_STRING\_TABLE\_add()** returns 1 on success, 0 if an error occurred.

**ASN1\_STRING\_TABLE\_get()** returns a valid **ASN1\_STRING\_TABLE** structure or NULL if nothing is found.

**ASN1\_STRING\_TABLE\_cleanup()** does not return a value.

## SEE ALSO

**ERR\_get\_error**(3)

## COPYRIGHT

Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use this file except in compliance with the License.  You can obtain a copy in the file LICENSE in the source distribution or at \<https://www.openssl.org/source/license.html\>.
