ASN1_STRING_set_by_NID

Create or update an ASN.1 string from multibyte input using the string table for nid.

Synopsis

Declared in <openssl/asn1.h>

ASN1_STRING*
ASN1_STRING_set_by_NID(
    ASN1_STRING** out,
    unsigned char const* in,
    int inlen,
    int inform,
    int nid);

Return Value

Resulting ASN1_STRING, or NULL on error.

Parameters

NameDescription
outOptional destination; if NULL a new string is allocated and returned.
inInput bytes in the encoding given by inform.
inlenLength of in in bytes, or -1 if in is NUL-terminated.
informInput encoding (MBSTRING_ASC, MBSTRING_BMP, MBSTRING_UNIV, or MBSTRING_UTF8).
nidObject NID whose ASN1_STRING_TABLE entry selects allowed string types and size limits.