ASN1_mbstring_copy

Convert multibyte input into an ASN.1 string, choosing a type allowed by mask.

Synopsis

Declared in <openssl/asn1.h>

int
ASN1_mbstring_copy(
    ASN1_STRING** out,
    unsigned char const* in,
    int len,
    int inform,
    unsigned long mask);

Return Value

Positive ASN.1 string type on success, or a negative value on error.

Parameters

NameDescription
outDestination; if NULL a new string is allocated, otherwise *out may be reused.
inInput bytes in the encoding given by inform.
lenLength of in in bytes, or -1 if in is NUL-terminated.
informInput encoding (MBSTRING_ASC, MBSTRING_BMP, MBSTRING_UNIV, or MBSTRING_UTF8).
maskB_ASN1_* bitmask of permitted output string types (0 selects the default mask).