OPENSSL_asc2uni

Convert an ASCII/ISO-8859-1 string to PKCS#12 BMPString form (zero-extended UTF-16BE).

Synopsis

Declared in <openssl/pkcs12.h>

unsigned char*
OPENSSL_asc2uni(
    char const* asc,
    int asclen,
    unsigned char** uni,
    int* unilen);

Return Value

Pointer to the BMPString (same as *uni when uni is non-NULL), or NULL on error.

Parameters

NameDescription
ascInput octets (typically ASCII or Latin-1).
asclenLength of asc in bytes, or -1 to use strlen().
uniOptional address of pointer updated to the allocated BMPString buffer.
unilenOptional address to receive BMPString length in bytes (including double NUL).