CMS_GET1_RECEIPTREQUEST(3)
CMS_GET1_RECEIPTREQUEST(3) π
β¨ NAME β¨
okay so bestie, this is the CMS_GET1_RECEIPTREQUEST(3) page from the Library Functions Manual, and it's all about the CMS signed receipt request functions: CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, and CMS_ReceiptRequest_get0_values. we are so in the right place π
πΈ SYNOPSIS πΈ
the library is libcrypto, and the header is <openssl/cms.h> β here's the whole cast, exactly as written, no edits:
library βlibcryptoβ #include <openssl/cms.h>
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()
okay so CMS_ReceiptRequest_create0() creates a brand-new ReceiptRequest structure. the signedContentIdentifier field gets set using id and idlen, or β if id is NULL β it gets set to 32 bytes of pseudo random data. if receiptList is NULL, the allOrFirstTier option in the receiptsFrom field is set to the value of the allorfirst argument. if receiptList is not NULL, the receiptList option in the receiptsFrom field is used instead. and the receiptsTo argument specifies the value of the receiptsTo field. slay. β¨
π§ CMS_add1_ReceiptRequest()
CMS_add1_ReceiptRequest() adds a BER-encoded copy of rr to si. that's it, that's the whole vibe. π
π¦ CMS_get1_ReceiptRequest()
CMS_get1_ReceiptRequest() looks for a signed receipt request in si. if any is found, it gets decoded and written to prr. iconic. π₯
π CMS_ReceiptRequest_get0_values()
CMS_ReceiptRequest_get0_values() retrieves the values of a receipt request. the signedContentIdentifier is copied to pcid. if the allOrFirstTier option is used in the receiptsFrom field, its value is copied to pallorfirst; otherwise the receiptList field is copied to plist. the receiptsTo field is copied to prto. got it? good, because we're keeping all of it. π«Ά
π important vibe check: the contents of a signed receipt should only be considered meaningful if the correspondingCMS_ContentInfostructure can be successfully verified usingCMS_verify(3). no cap, don't skip the verify step.
π RETURN VALUES π
CMS_ReceiptRequest_create0()β returns the new signed receipt request structure, orNULLif an error occurred. πCMS_add1_ReceiptRequest()β returns1for success or0if an error occurred. periodt.CMS_get1_ReceiptRequest()β returns1if a signed receipt request is found and decoded. returns0if a signed receipt request is not present, or-1if it is present but malformed. yes, three whole outcomes, bestie. π
π SEE ALSO π
CMS_ContentInfo_new(3), CMS_sign(3), CMS_sign_receipt(3), CMS_verify(3), CMS_verify_receipt(3), ERR_get_error(3) β go read these too, iykyk. π
β STANDARDS β
RFC 2634: Enhanced Security Services for S/MIME, section 2.7: Receipt Request Syntax β that's the standard, exact and everything. π
π HISTORY π
CMS_ReceiptRequest_create0(), CMS_add1_ReceiptRequest(), CMS_get1_ReceiptRequest(), and CMS_ReceiptRequest_get0_values() first appeared in OpenSSL 0.9.8h and have been available since OpenBSD 6.7. history lesson, but make it cute. β¨
π and that's the whole page, bestie β Debian, June 8, 2025, CMS_GET1_RECEIPTREQUEST(3), signing off. byeee! π
π¦ 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) 2008 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms