[#CMS_sign]
= CMS&lowbar;sign
:mrdocs:

Create a CMS SignedData structure with the default library context&period;

== Synopsis

Declared in `&lt;openssl&sol;cms&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CMS_ContentInfo.adoc[CMS&lowbar;ContentInfo]*
CMS&lowbar;sign(
    xref:X509.adoc[X509]* signcert,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    stack&lowbar;st&lowbar;X509* certs,
    xref:BIO.adoc[BIO]* data,
    unsigned int flags);
----

== Return Value

New SignedData ContentInfo, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *signcert*
| Signer certificate corresponding to `pkey,` or NULL for certificates&hyphen;only&period;
| *pkey*
| Signer private key, or NULL when only embedding certificates&period;
| *certs*
| Optional intermediate certificates to include, or NULL&period;
| *data*
| Content BIO to sign&period;
| *flags*
| CMS signing flags (for example CMS&lowbar;DETACHED, CMS&lowbar;BINARY)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
