CMS_GET1_RECEIPTREQUEST(3ossl)
๐ CMS_GET1_RECEIPTREQUEST(3ossl) โ the receipt-request glow-up
okay bestie, so this is the CMS_GET1_RECEIPTREQUEST(3ossl) manual page, and it's literally all about CMS signed receipt requests โ the "yes i got your message, here's proof ๐
" of the crypto world. Six functions, zero fluff, let's go ๐
โจ NAME โจ
CMS_ReceiptRequest_create0_ex, CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, CMS_ReceiptRequest_get0_values โ the CMS signed receipt request functions ๐ง
๐ธ SYNOPSIS ๐ธ
#include <openssl/cms.h>
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo,
OSSL_LIB_CTX *libctx);
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
unsigned char *id, int idlen, int allorfirst,
STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo);
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid,
int *pallorfirst,
STACK_OF(GENERAL_NAMES) **plist,
STACK_OF(GENERAL_NAMES) **prto);
๐ DESCRIPTION ๐
So CMS_ReceiptRequest_create0_ex() is the main character here โ it creates a signed receipt request structure. ๐ซถ
- The
signedContentIdentifierfield gets set usingidandidlenโฆ unlessidisNULL, in which case it gets set to 32 bytes of pseudo random data instead. iconic behavior ngl โจ - If
receiptListisNULL, theallOrFirstTieroption inreceiptsFromis used, and it's set to the value of theallorfirstparameter. ๐ฏ - If
receiptListis notNULL, thereceiptListoption inreceiptsFromis used instead. slay, choose your fighter ๐ - The
receiptsToparameter specifies thereceiptsTofield value. ๐ฌ - The library context
libctxis used to find the public random generator. ๐ฒ
CMS_ReceiptRequest_create0() is basically the same vibe as CMS_ReceiptRequest_create0_ex() โ literally similar โ except it uses default values of NULL for the library context libctx. no ctx, no problem ๐
CMS_add1_ReceiptRequest() adds a signed receipt request rr to the SignerInfo structure si. it's giving "attach the receipt to the signerinfo, periodt" ๐
int CMS_get1_ReceiptRequest() looks for a signed receipt request in si, and if any is found, it gets decoded and written to prr. ๐
CMS_ReceiptRequest_get0_values() retrieves the values of a receipt request, bestie:
- The
signedContentIdentifieris copied topcid. ๐ - If the
allOrFirstTieroption ofreceiptsFromis used, its value is copied topallorfirstโ otherwise thereceiptListfield is copied toplist. ๐ - The
receiptsToparameter is copied toprto. ๐ฎ
๐ฆ NOTES ๐ฆ
For more deets on what all these fields actually mean, see RFC2634. iykyk ๐
โ ๏ธ The contents of a signed receipt should only be considered meaningful if the correspondingCMS_ContentInfostructure can be successfully verified usingCMS_verify(). like, don't trust a receipt you can't verify, fr fr ๐
๐ฅ RETURN VALUES ๐ฅ
CMS_ReceiptRequest_create0_ex()andCMS_ReceiptRequest_create0()return a signed receipt request structure, orNULLif an error occurred. ๐ญCMS_add1_ReceiptRequest()returns1for success or0if an error occurred. โCMS_get1_ReceiptRequest()returns1if a signed receipt request is found and decoded. It returns0if a signed receipt request is not present, and-1if it is present but malformed. three whole moods ๐
๐ SEE ALSO ๐
ERR_get_error(3), CMS_sign(3), CMS_sign_receipt(3), CMS_verify(3), CMS_verify_receipt(3) โ go read those too, bestie, they're all linked in the group chat ๐ซถ
โญ HISTORY โญ
The function CMS_ReceiptRequest_create0_ex() was added in OpenSSL 3.0. new-ish but already iconic ๐
๐ COPYRIGHT ๐
Copyright 2008-2021 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 cap ๐ this was OpenSSL 3.5.0, dated 2026-09-25, and the manual page is CMS_GET1_RECEIPTREQUEST(3ossl) โ receipts have never looked this cute ๐โจ๐
๐ฆ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms