D2I_CMS_CONTENTINFO(3)
π D2I_CMS_CONTENTINFO π
okay so bestie, this is a page from the Library Functions Manual, section 3 β and it's all about the libcrypto girlies who turn Cryptographic Message Syntax data into bytes and back again. β¨
πΈ 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 π¦
library βlibcryptoβ
#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 π
so these functions are literally the decode-and-encode duo for Cryptographic Message Syntax data structures. that's their whole job. π
okay but fr, for the details about the semantics, examples, caveats, and bugs β go read ASN1_item_d2i(3). that's where the lore lives. π
d2i_CMS_ContentInfo() and i2d_CMS_ContentInfo() decode and encode a CMS_ContentInfo structure defined in RFC 5652 section 3. iconic. π
d2i_CMS_bio() and i2d_CMS_bio() are similar except that they decode or encode using a BIO pointer. same energy, different doorway. πͺβ¨
d2i_CMS_ReceiptRequest() and i2d_CMS_ReceiptRequest() decode and encode a CMS_ReceiptRequest structure defined in RFC 2634 section 2.7. receipts! literally. π§Ύ
β RETURN VALUES β
d2i_CMS_ContentInfo()andd2i_CMS_bio()return a validCMS_ContentInfostructure β orNULLif an error occurs. πd2i_CMS_ReceiptRequest()returns a validCMS_ReceiptRequeststructure β orNULLif an error occurs. πi2d_CMS_ContentInfo()andi2d_CMS_ReceiptRequest()return the number of bytes successfully encoded, or a negative value if an error occurs. π₯i2d_CMS_bio()returns1for success or0if an error occurs. periodt. π- For all functions, the error code can be obtained by
ERR_get_error(3). that's your girl when things go sideways. π«Ά
π 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. she's been on the scene for a minute, ngl. π
and that's the whole vibe check π§π β sourced from Debian, dated June 8, 2025, page D2I_CMS_CONTENTINFO(3). slay, you're welcome, mwah ππ
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms