---
name: "libressl-X509_REQ_print_ex"
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-X509_REQ_print_ex"
---

# libressl-X509\_REQ\_print\_ex(3)

pretty-print a PKCS#10 certification request

## NAME

**X509\_REQ\_print\_ex**, **X509\_REQ\_print**, **X509\_REQ\_print\_fp** – pretty-print a PKCS#10 certification request

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*int*\

**X509\_REQ\_print\_ex**(*BIO \*bio*, *X509\_REQ \*req*, *unsigned long nameflags*, *unsigned long skipflags*);

*int*\

**X509\_REQ\_print**(*BIO \*bio*, *X509\_REQ \*req*);

*int*\

**X509\_REQ\_print\_fp**(*FILE \*fp*, *X509\_REQ \*req*);

## DESCRIPTION

**X509\_REQ\_print\_ex**() prints information contained in *req* to *bio* in human-readable form. Printing is aborted as soon as any operation fails, with the exception that failures while attempting to decode or print the public key are not considered as errors.

By default, the following blocks of information are printed in the following order. Each block can be skipped by setting the corresponding bit in *skipflags*, provided in parentheses after each block description.

- A pair of lines reading "Certificate Request:" and "Data:" containing no information. (X509\_FLAG\_NO\_HEADER)

- The value contained in the version field in decimal and hexadecimal notation. (X509\_FLAG\_NO\_VERSION)

- The subject name is printed with X509\_NAME\_print\_ex(3). (X509\_FLAG\_NO\_SUBJECT)

- The public key algorithm is printed with i2a\_ASN1\_OBJECT(3), and the public key returned from X509\_REQ\_get\_pubkey(3) with EVP\_PKEY\_print\_public(3). (X509\_FLAG\_NO\_PUBKEY)

- For each X.501 attribute that is not a requested extension according to X509\_REQ\_extension\_nid(3), the object identifier is printed with i2a\_ASN1\_OBJECT(3), and all values of the types V\_ASN1\_PRINTABLESTRING, V\_ASN1\_T61STRING, and V\_ASN1\_IA5STRING are printed with BIO\_write(3). (X509\_FLAG\_NO\_ATTRIBUTES)

- The requested extensions are retrieved with X509\_REQ\_get\_extensions(3) and their types and values are printed with i2a\_ASN1\_OBJECT(3) and X509V3\_EXT\_print(3), or, if the latter fails, with ASN1\_STRING\_print(3). (X509\_FLAG\_NO\_EXTENSIONS)

- The signature is printed with X509\_signature\_print(3). (X509\_FLAG\_NO\_SIGDUMP)

The *nameflags* argument modifies the format for printing X.501 *Name* objects contained in *req*. It is passed through to X509\_NAME\_print\_ex(3). If *nameflags* is X509\_FLAG\_COMPAT, the *indent* argument of X509\_NAME\_print\_ex(3) is set to 16 spaces and the traditional SSLeay format is used. Otherwise, if the only bit set in XN\_FLAG\_SEP\_MASK is XN\_FLAG\_SEP\_MULTILINE, *indent* is set to 12 spaces. Otherwise, indent is set to zero.

**X509\_REQ\_print**() is a wrapper function setting the *nameflags* to XN\_FLAG\_COMPAT and the *skipflags* to X509\_FLAG\_COMPAT.

**X509\_REQ\_print\_fp**() is similar to **X509\_REQ\_print**() except that it prints to *fp*.

## RETURN VALUES

These functions return 1 if all requested information was successfully printed, even if failures occurred while attempting to decode or print the public key, or 0 if any operation fails.

## SEE ALSO

BIO\_new(3), X509\_print\_ex(3), X509\_REQ\_new(3)

## HISTORY

**X509\_REQ\_print**() first appeared in SSLeay 0.4.4 and **X509\_REQ\_print\_fp**() in SSLeay 0.6.0. These functions have been available since OpenBSD 2.4.

**X509\_REQ\_print\_ex**() first appeared in OpenSSL 0.9.7 and has been available since OpenBSD 3.2.

## BUGS

Some printing failures are silently ignored while printing extensions, which may result in incomplete data being printed.
