---
name: "libressl-CMS_get1_ReceiptRequest"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-CMS_get1_ReceiptRequest"
---

# libressl-CMS\_get1\_ReceiptRequest(3)

CMS signed receipt request functions

## NAME

**CMS\_ReceiptRequest\_create0**, **CMS\_add1\_ReceiptRequest**, **CMS\_get1\_ReceiptRequest**, **CMS\_ReceiptRequest\_get0\_values** – CMS signed receipt request functions

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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**() creates a new *ReceiptRequest* structure. The *signedContentIdentifier* field is set using *id* and *idlen*, or it is set to 32 bytes of pseudo random data if *id* is NULL. 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. The *receiptsTo* argument specifies the value of the *receiptsTo* field.

**CMS\_add1\_ReceiptRequest**() adds a BER-encoded copy of *rr* to *si*.

**CMS\_get1\_ReceiptRequest**() looks for a signed receipt request in *si*. If any is found, it is decoded and written to *prr*.

**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*.

The contents of a signed receipt should only be considered meaningful if the corresponding *CMS\_ContentInfo* structure can be successfully verified using CMS\_verify(3).

## RETURN VALUES

**CMS\_ReceiptRequest\_create0**() returns the new 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 is a signed receipt request is found and decoded. It returns 0 if a signed receipt request is not present or -1 if it is present but malformed.

## SEE ALSO

CMS\_ContentInfo\_new(3), CMS\_sign(3), CMS\_sign\_receipt(3), CMS\_verify(3), CMS\_verify\_receipt(3), ERR\_get\_error(3)

## STANDARDS

RFC 2634: Enhanced Security Services for S/MIME, section 2.7: Receipt Request Syntax

## 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.
