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

# libressl-d2i\_CMS\_ContentInfo(3)

decode and encode Cryptographic Message Syntax data

## NAME

**d2i\_CMS\_ContentInfo**, **i2d\_CMS\_ContentInfo**, **d2i\_CMS\_bio**, **i2d\_CMS\_bio**, **d2i\_CMS\_ReceiptRequest**, **i2d\_CMS\_ReceiptRequest** – decode and encode Cryptographic Message Syntax data

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

*CMS\_ContentInfo* *\**\

**d2i\_CMS\_ContentInfo**(*CMS\_ContentInfo \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_CMS\_ContentInfo**(*CMS\_ContentInfo \*val\_in*, *unsigned char \*\*out*);

*CMS\_ContentInfo* *\**\

**d2i\_CMS\_bio**(*BIO \*in\_bio*, *CMS\_ContentInfo \*\*val\_out*);

*int*\

**i2d\_CMS\_bio**(*BIO \*out\_bio*, *CMS\_ContentInfo \*val\_in*);

*CMS\_ReceiptRequest* *\**\

**d2i\_CMS\_ReceiptRequest**(*CMS\_ReceiptRequest \*\*val\_out*, *const unsigned char \*\*der\_in*, *long length*);

*int*\

**i2d\_CMS\_ReceiptRequest**(*CMS\_ReceiptRequest \*val\_in*, *unsigned char \*\*out*);

## DESCRIPTION

These functions decode and encode Cryptographic Message Syntax data structures. For details about the semantics, examples, caveats, and bugs, see ASN1\_item\_d2i(3).

**d2i\_CMS\_ContentInfo**() and **i2d\_CMS\_ContentInfo**() decode and encode a *CMS\_ContentInfo* structure defined in RFC 5652 section 3. **d2i\_CMS\_bio**() and **i2d\_CMS\_bio**() are similar except that they decode or encode using a *BIO* pointer.

**d2i\_CMS\_ReceiptRequest**() and **i2d\_CMS\_ReceiptRequest**() decode and encode a *CMS\_ReceiptRequest* structure defined in RFC 2634 section 2.7.

## RETURN VALUES

**d2i\_CMS\_ContentInfo**() and **d2i\_CMS\_bio**() return a valid *CMS\_ContentInfo* structure or NULL if an error occurs.

**d2i\_CMS\_ReceiptRequest**() returns a valid *CMS\_ReceiptRequest* structure or NULL if an error occurs.

**i2d\_CMS\_ContentInfo**() and **i2d\_CMS\_ReceiptRequest**() return the number of bytes successfully encoded or a negative value if an error occurs.

**i2d\_CMS\_bio**() returns 1 for success or 0 if an error occurs.

For all functions, the error code can be obtained by ERR\_get\_error(3).

## SEE ALSO

ASN1\_item\_d2i(3), CMS\_ContentInfo\_new(3), CMS\_get0\_type(3), CMS\_ReceiptRequest\_create0(3), i2d\_CMS\_bio\_stream(3)

## STANDARDS

RFC 5652: Cryptographic Message Syntax, section 3: General Syntax

RFC 2634: Enhanced Security Services for S/MIME, section 2.7: Receipt Request Syntax

## HISTORY

These functions first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 6.7.
