CMS_GET1_RECEIPTREQUEST(3ossl)
π NAME π
okay so bestie, this is the CMS signed receipt request page β it covers CMS_ReceiptRequest_create0_ex, CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, and CMS_ReceiptRequest_get0_values. it's from the OpenSSL manual, section 3ossl, and honestly? these are the functions that make signed receipts a whole thing. π§Ύβ¨
β¨ 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 πΈ
CMS_ReceiptRequest_create0_ex() is the one that creates a signed receipt request structure. no cap. here's the tea on how it fills stuff in:
- the
signedContentIdentifierfield gets set usingidandidlenβ but ifidisNULL, it just gets set to 32 bytes of pseudo random data instead π² - if
receiptListisNULL, theallOrFirstTieroption inreceiptsFromis used and set to the value of theallorfirstparameter - if
receiptListis notNULL, thereceiptListoption inreceiptsFromis used instead - the
receiptsToparameter specifies thereceiptsTofield value - the library context
libctxis used to find the public random generator π
CMS_ReceiptRequest_create0() is literally the same vibe as CMS_ReceiptRequest_create0_ex() but it uses default values of NULL for the library context libctx. she's low maintenance like that. π«Ά
The CMS_add1_ReceiptRequest() function adds a signed receipt request rr to the SignerInfo structure si. it's giving "adding to the group chat."
int CMS_get1_ReceiptRequest() goes looking 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:
- 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 details of the meaning of the fields, go read 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 it otherwise bestie. verify first, always. π
π₯ RETURN VALUES π₯
CMS_ReceiptRequest_create0_ex() and CMS_ReceiptRequest_create0() return a signed receipt request structure, or NULL if an error occurred. π
CMS_add1_ReceiptRequest() returns 1 for success or 0 if an error occurred.
CMS_get1_ReceiptRequest() returns 1 if a signed receipt request is found and decoded. it returns 0 if a signed receipt request is not present, and -1 if it is present but malformed. three moods, honestly. π
π SEE ALSO π
β HISTORY β
the function CMS_ReceiptRequest_create0_ex() was added in OpenSSL 3.0. she's new-ish, she's iconic, periodt. π
π 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>.
okay that's the whole page bestie, hope it ate π this was OpenSSL version 3.5.9, dated 2026-09-29, and yes, the manual name really is CMS_GET1_RECEIPTREQUEST(3ossl) β go forth and sign those receipts, main character. π¦π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms