CMS_SIGN_RECEIPT(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… CMS_SIGN_RECEIPT(3) β€” like, the cute little libcrypto manual page, bestie

okay so picture this: you're deep in the OpenSSL headers, right? This is a page from the Library Functions Manual and it's all about making a signed receipt. Yes, receipts. Like when you need proof someone got your mail. Obsessed. Let's get into it 🧚


✨ NAME ✨

CMS_sign_receipt β€” bestie, it literally creates a CMS signed receipt πŸ’Œ


πŸ¦‹ SYNOPSIS πŸ¦‹

library β€œlibcrypto” #include <openssl/cms.h>

CMS_ContentInfo *
CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, EVP_PKEY *pkey,
    STACK_OF(X509) *certs, unsigned int flags);

🌸 DESCRIPTION 🌸

So CMS_sign_receipt() does the thing: it creates a brand new CMS SignedData structure, and its embedded content is a signed Receipt. Iconic behavior, honestly.

Let's break down the cast of characters (the args, bestie, keep up 🫢):

  • si β€” the SignerInfo structure that's holding the signed receipt request. She's the main character.
  • signcert β€” the certificate you're signing with ✍️
  • pkey β€” the matching private key for that cert. yes they're a package deal, no cap.
  • certs β€” an optional extra set of certificates to shove into the CMS structure (like, say, any intermediate CAs hanging out in the chain). optional means optional, but she's there if you need her πŸ’–
  • flags β€” the flags. but read the next bit, because not all flags are welcome here.

The tea β˜•: this function behaves similarly to CMS_sign(3), except that these flags values are not supported:

  • CMS_DETACHED
  • CMS_BINARY
  • CMS_NOATTR
  • CMS_TEXT
  • CMS_STREAM

Why? Because they literally do not make sense in the context of signed receipts. It's giving "wrong vibe, wrong party." So don't pass them. Fr fr. πŸ™ˆ


πŸ‘‘ RETURN VALUES πŸ‘‘

CMS_sign_receipt() returns either a valid CMS_ContentInfo structure (slay) or NULL if an error occurred (πŸ’€). If you got NULL, you can grab the error from ERR_get_error(3). Go check, don't just sit there wondering.


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, honestly. go read them too 🌈


⭐ STANDARDS ⭐

RFC 2634: Enhanced Security Services for S/MIME, section 2.8: Receipt Syntax. yes, we cite our sources, we're classy like that πŸŽ€


πŸ¦‹ HISTORY πŸ¦‹

CMS_sign_receipt() first appeared in OpenSSL 0.9.8h and has been available since OpenBSD 6.7. a whole little timeline, we love a glow-up ✨


and that's the page, bestie πŸ’œ this cutie came from Debian, dated December 20, 2025 β€” the CMS_SIGN_RECEIPT(3) of it all. drink some water, go sign a receipt, periodt 🫢

πŸ“¦ where this page comes from