
#use wml::openssl-macros area=docs page=CMS_get1_ReceiptRequest

<title>Documents, CMS_get1_ReceiptRequest(3)</title>

<h1>CMS_get1_ReceiptRequest(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<PRE> CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, CMS_ReceiptRequest_get0_values - CMS signed receipt request functions.
</PRE>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/cms.h&gt;
</PRE>
<PRE> 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);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>CMS_ReceiptRequest_create0()</CODE> creates a signed receipt request
structure. The
<STRONG>signedContentIdentifier</STRONG> field is set using <STRONG>id</STRONG> and <STRONG>idlen</STRONG>, or it is set to 32 bytes of pseudo random data if <STRONG>id</STRONG> is NULL. If <STRONG>receiptList</STRONG> is NULL the allOrFirstTier option in <STRONG>receiptsFrom</STRONG> is used and set to the value of the <STRONG>allorfirst</STRONG> parameter. If <STRONG>receiptList</STRONG> is not NULL the <STRONG>receiptList</STRONG>
option in <STRONG>receiptsFrom</STRONG> is used. The <STRONG>receiptsTo</STRONG> parameter specifies the
<STRONG>receiptsTo</STRONG> field value.

</P>
<P>
The <CODE>CMS_add1_ReceiptRequest()</CODE> function adds a signed receipt
request <STRONG>rr</STRONG>
to SignerInfo structure <STRONG>si</STRONG>.

</P>
<P>
int <CODE>CMS_get1_ReceiptRequest()</CODE> looks for a signed receipt
request in <STRONG>si</STRONG>, if any is found it is decoded and written to <STRONG>prr</STRONG>.

</P>
<P>
<CODE>CMS_ReceiptRequest_get0_values()</CODE> retrieves the values of a
receipt request. The signedContentIdentifier is copied to <STRONG>pcid</STRONG>. If the <STRONG>allOrFirstTier</STRONG>
option of <STRONG>receiptsFrom</STRONG> is used its value is copied to <STRONG>pallorfirst</STRONG>
otherwise the <STRONG>receiptList</STRONG> field is copied to <STRONG>plist</STRONG>. The <STRONG>receiptsTo</STRONG>
parameter is copied to <STRONG>prto</STRONG>.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
For more details of the meaning of the fields see RFC2634.

</P>
<P>
The contents of a signed receipt should only be considered meaningful if
the corresponding CMS_ContentInfo structure can be successfully verified
using <CODE>CMS_verify().</CODE>

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>CMS_ReceiptRequest_create0()</CODE> returns a signed receipt request
structure or NULL if an error occurred.

</P>
<P>
<CODE>CMS_add1_ReceiptRequest()</CODE> returns 1 for success or 0 is an
error occurred.

</P>
<P>
<CODE>CMS_get1_ReceiptRequest()</CODE> returns 1 is 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.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/ERR_get_error.html#">ERR_get_error(3)</A>, <A HREF="../crypto/CMS_sign.html#">CMS_sign(3)</A>,
<A HREF="../crypto/CMS_sign_receipt.html#">CMS_sign_receipt(3)</A>, <A HREF="../crypto/CMS_verify.html#">CMS_verify(3)</A>

<A HREF="../crypto/CMS_verify_receipt.html#">CMS_verify_receipt(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>CMS_ReceiptRequest_create0(),</CODE>
<CODE>CMS_add1_ReceiptRequest(),</CODE>
<CODE>CMS_get1_ReceiptRequest()</CODE> and
<CODE>CMS_ReceiptRequest_get0_values()</CODE> were added to OpenSSL 0.9.8

</P>
:}


