libressl-d2i_POLICYINFO(3)

libressl-d2i_POLICYINFO3

Decode and encode x.509 certificate policies

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/x509v3.h>

POLICYINFO *

d2i_POLICYINFO(POLICYINFO **val_out, const unsigned char **der_in, long length);

int

i2d_POLICYINFO(POLICYINFO *val_in, unsigned char **der_out);

CERTIFICATEPOLICIES *

d2i_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES **val_out, const unsigned char **der_in, long length);

int

i2d_CERTIFICATEPOLICIES(CERTIFICATEPOLICIES *val_in, unsigned char **der_out);

POLICYQUALINFO *

d2i_POLICYQUALINFO(POLICYQUALINFO **val_out, const unsigned char **der_in, long length);

int

i2d_POLICYQUALINFO(POLICYQUALINFO *val_in, unsigned char **der_out);

USERNOTICE *

d2i_USERNOTICE(USERNOTICE **val_out, const unsigned char **der_in, long length);

int

i2d_USERNOTICE(USERNOTICE *val_in, unsigned char **der_out);

NOTICEREF *

d2i_NOTICEREF(NOTICEREF **val_out, const unsigned char **der_in, long length);

int

i2d_NOTICEREF(NOTICEREF *val_in, unsigned char **der_out);

Overview

These functions decode and encode X.509 certificate policies. For details about the semantics, examples, caveats, and bugs, see ASN1_item_d2i(3).

d2i_POLICYINFO() and i2d_POLICYINFO() decode and encode an ASN.1 PolicyInformation structure defined in RFC 5280 section 4.2.1.4.

d2i_CERTIFICATEPOLICIES() and i2d_CERTIFICATEPOLICIES() decode and encode an ASN.1 CertificatePolicies structure defined in RFC 5280 section 4.2.1.4.

d2i_POLICYQUALINFO() and i2d_POLICYQUALINFO() decode and encode an ASN.1 PolicyQualifierInfo structure defined in RFC 5280 section 4.2.1.4.

d2i_USERNOTICE() and i2d_USERNOTICE() decode and encode an ASN.1 UserNotice structure defined in RFC 5280 section 4.2.1.4.

d2i_NOTICEREF() and i2d_NOTICEREF() decode and encode an ASN.1 NoticeReference structure defined in RFC 5280 section 4.2.1.4.

Return values

d2i_POLICYINFO(), d2i_CERTIFICATEPOLICIES(), d2i_POLICYQUALINFO(), d2i_USERNOTICE(), and d2i_NOTICEREF() return a POLICYINFO, CERTIFICATEPOLICIES, POLICYQUALINFO, USERNOTICE, or NOTICEREF object, respectively, or NULL if an error occurs.

i2d_POLICYINFO(), i2d_CERTIFICATEPOLICIES(), i2d_POLICYQUALINFO(), i2d_USERNOTICE(), and i2d_NOTICEREF() return the number of bytes successfully encoded or a negative value if an error occurs.

Standards

RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile, section 4.2.1.4: Certificate Policies

History

These functions first appeared in OpenSSL 0.9.3 and have been available since OpenBSD 2.6.

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