---
name: "libressl-ASN1_PRINTABLE_type"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-ASN1_PRINTABLE_type"
---

# libressl-ASN1\_PRINTABLE\_type(3)

classify a single-byte character string

## NAME

**ASN1\_PRINTABLE\_type** – classify a single-byte character string

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/asn1.h\>**

*int*\

**ASN1\_PRINTABLE\_type**(*const unsigned char \*string*, *int len*);

## DESCRIPTION

**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)](/ascii/7.md) 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.

## SEE ALSO

ASN1\_mbstring\_copy(3), ASN1\_STRING\_new(3), ASN1\_STRING\_to\_UTF8(3), [isascii(3)](/isascii/3.md), [ascii(7)](/ascii/7.md)

## HISTORY

**ASN1\_PRINTABLE\_type**() first appeared in SSLeay 0.4.5d, has been part of the public API since SSLeay 0.5.1, and has been available since OpenBSD 2.4.

## CAVEATS

The ASN.1 notion of what constitutes a *PrintableString* is more restrictive than what the C library function [isprint(3)](/isprint/3.md) considers printable.
