libressl-d2i_CMS_ContentInfo(3)

libressl-d2i_CMS_ContentInfo3

Decode and encode cryptographic message syntax data

Usage

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

Overview

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

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.

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