libressl-ASN1_PRINTABLE_type3
Classify a single-byte character string
Usage
Crypto Library
(libcrypto,
-lcrypto)
int
Overview
ASN1_PRINTABLE_type() assumes that the given string consists of single-byte characters and classifies it according to which kinds characters occur. If len is greater than 0, at most len characters are inspected. Otherwise, the string needs to be NUL-terminated.
Return values
If the given string contains a character outside the ascii(7) range, ASN1_PRINTABLE_type() returns V_ASN1_T61STRING.
Otherwise, if it contains a character that is neither a letter nor a digit nor the space character( ‘ ’, ASCII 0x20) nor the apostrophe quote( ‘'’, ASCII 0x27) nor contained in the set "()+,-./:=?", it returns V_ASN1_IA5STRING.
Otherwise, including if string is a NULL pointer or points to an empty string, it returns V_ASN1_PRINTABLESTRING.
Caveats
The ASN.1 notion of what constitutes a PrintableString is more restrictive than what the C library function isprint(3) considers printable.