ASN1_mbstring_ncopy

Like ASN1_mbstring_copy(), also enforcing minimum and maximum character counts.

Synopsis

Declared in <openssl/asn1.h>

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

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).
minsizeMinimum character count (0 disables the check).
maxsizeMaximum character count (0 disables the check).