CMS_SIGN_RECEIPT(3SSL)

πŸ’– CMS_SIGN_RECEIPT β€” the OpenSSL girlies' guide πŸ’–

okay so this is a page from the OpenSSL manual, section 3SSL, and it's about CMS_sign_receipt. no cap, it's lowkey the receipt-printing queen of the CMS world. let's get into it bestie 🫢


✨ NAME ✨

CMS_sign_receipt β€” create a CMS signed receipt πŸ“πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/cms.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so CMS_sign_receipt() creates and returns a CMS signed receipt structure. that's the whole gig. iconic. πŸ‘‘

here's the vibe check on the args:

  • si β€” this is the CMS_SignerInfo structure holding the signed receipt request. it's giving "here's what you asked me to sign" energy.
  • signcert β€” the certificate you're signing with πŸŽ€
  • pkey β€” the corresponding private key, obvs. they're a package deal, iykyk.
  • certs β€” an optional extra set of certificates to include in the CMS structure. think intermediate CAs in the chain, like the supporting cast. 🌈
  • flags β€” an optional set of flags. yeah, we'll talk about which ones.

πŸ’€ NOTES πŸ’€

okay so this function behaves in a similar way to CMS_sign()... except (and this is the important part, bestie, don't skip it πŸ™ˆ) these flag 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 room, wrong party". they just don't belong. periodt. βœ‹


πŸ‘‘ RETURN VALUES πŸ‘‘

CMS_sign_receipt() returns either:

  • a valid CMS_ContentInfo structure ✨ (slay), or
  • NULL if an error occurred 😭

and if you got the NULL, you can snag the error info from ERR_get_error(3). go get your diagnostics, girlie.


πŸ”₯ SEE ALSO πŸ”₯


Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution, or at <https://www.openssl.org/source/license.html>.


and that's the whole page, no crumbs left πŸ“

OpenSSL 4.0.3 β€” dated 2026-09-29 β€” CMS_SIGN_RECEIPT(3SSL), mwah πŸ’‹ signing off bestie, go make some receipts πŸŽ€βœ¨

πŸ“¦ where this page comes from