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

# libressl-d2i\_POLICYINFO(3)

decode and encode X.509 certificate policies

## NAME

**d2i\_POLICYINFO**, **i2d\_POLICYINFO**, **d2i\_CERTIFICATEPOLICIES**, **i2d\_CERTIFICATEPOLICIES**, **d2i\_POLICYQUALINFO**, **i2d\_POLICYQUALINFO**, **d2i\_USERNOTICE**, **i2d\_USERNOTICE**, **d2i\_NOTICEREF**, **i2d\_NOTICEREF** – decode and encode X.509 certificate policies

## SYNOPSIS

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*);

## DESCRIPTION

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.

## SEE ALSO

ASN1\_item\_d2i(3), POLICYINFO\_new(3), X509\_EXTENSION\_new(3)

## 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.
