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

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

<h1>CMS_sign_receipt(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_sign_receipt - create a CMS signed receipt
</PRE>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/cms.h&gt;
</PRE>
<PRE> CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>CMS_sign_receipt()</CODE> creates and returns a CMS signed receipt
structure. <STRONG>si</STRONG> is the <STRONG>CMS_SignerInfo</STRONG> structure containing the signed receipt request.
<STRONG>signcert</STRONG> is the certificate to sign with, <STRONG>pkey</STRONG> is the corresponding private key.  <STRONG>certs</STRONG> is an optional additional set of certificates to include in the CMS
structure (for example any intermediate CAs in the chain).

</P>
<P>
<STRONG>flags</STRONG> is an optional set of flags.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
This functions behaves in a similar way to <CODE>CMS_sign()</CODE> except
the flag values
<STRONG>CMS_DETACHED</STRONG>, <STRONG>CMS_BINARY</STRONG>, <STRONG>CMS_NOATTR</STRONG>, <STRONG>CMS_TEXT</STRONG> and <STRONG>CMS_STREAM</STRONG>
are not supported since they do not make sense in the context of signed
receipts.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>CMS_sign_receipt()</CODE> returns either a valid CMS_ContentInfo
structure or NULL if an error occurred. The error can be obtained from
<CODE>ERR_get_error(3).</CODE>

</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_verify_receipt.html#">CMS_verify_receipt(3)</A>,
<A HREF="../crypto/CMS_sign.html#">CMS_sign(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>CMS_sign_receipt()</CODE> was added to OpenSSL 0.9.8

</P>
:}


