libressl-d2i_X509_REQ(3)

libressl-d2i_X509_REQ3

Decode and encode pkcs#10 certification requests

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509.h>

X509_REQ *

d2i_X509_REQ(X509_REQ **val_out, const unsigned char **der_in, long length);

int

i2d_X509_REQ(X509_REQ *val_in, unsigned char **der_out);

X509_REQ *

d2i_X509_REQ_bio(BIO *in_bio, X509_REQ **val_out);

X509_REQ *

d2i_X509_REQ_fp(FILE *in_fp, X509_REQ **val_out);

int

i2d_X509_REQ_bio(BIO *out_bio, X509_REQ *val_in);

int

i2d_X509_REQ_fp(FILE *out_fp, X509_REQ *val_in);

X509_REQ_INFO *

d2i_X509_REQ_INFO(X509_REQ_INFO **val_out, const unsigned char **der_in, long length);

int

i2d_X509_REQ_INFO(X509_REQ_INFO *val_in, unsigned char **der_out);

Overview

These functions decode and encode PKCS#10 certification requests. For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3).

d2i_X509_REQ() and i2d_X509_REQ() decode and encode an ASN.1 CertificationRequest structure defined in RFC 2986 section 4.2. d2i_X509_REQ_bio(), d2i_X509_REQ_fp(), i2d_X509_REQ_bio(), and i2d_X509_REQ_fp() are similar except that they decode or encode using a BIO or FILE pointer.

d2i_X509_REQ_INFO() and i2d_X509_REQ_INFO() decode and encode an ASN.1 CertificationRequestInfo structure defined in RFC 2986 section 4.1.

Return values

d2i_X509_REQ(), d2i_X509_REQ_bio(), and d2i_X509_REQ_fp() return an X509_REQ object or NULL if an error occurs.

d2i_X509_REQ_INFO() returns an X509_REQ_INFO object or NULL if an error occurs.

i2d_X509_REQ() and i2d_X509_REQ_INFO() return the number of bytes successfully encoded or a negative value if an error occurs.

i2d_X509_REQ_bio() and i2d_X509_REQ_fp() return 1 for success or 0 if an error occurs.

Standards

RFC 2986: PKCS #10: Certification Request Syntax Specification

History

d2i_X509_REQ(), i2d_X509_REQ(), d2i_X509_REQ_fp(), i2d_X509_REQ_fp(), d2i_X509_REQ_INFO(), and i2d_X509_REQ_INFO() first appeared in SSLeay 0.5.1. d2i_X509_REQ_bio() and i2d_X509_REQ_bio() first appeared in SSLeay 0.6.0. These functions have been available since OpenBSD 2.4.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.