[#PKCS7_add_signature]
= PKCS7&lowbar;add&lowbar;signature
:mrdocs:

Create a signer info from `x509` &sol; `pkey` &sol; `dgst` and add it to signed PKCS&num;7 `p7&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:PKCS7_SIGNER_INFO.adoc[PKCS7&lowbar;SIGNER&lowbar;INFO]*
PKCS7&lowbar;add&lowbar;signature(
    xref:PKCS7.adoc[PKCS7]* p7,
    xref:X509.adoc[X509]* x509,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* dgst);
----

== Return Value

The new PKCS7&lowbar;SIGNER&lowbar;INFO on success, or NULL on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *p7*
| PKCS&num;7 SignedData (or signed&hyphen;and&hyphen;enveloped) object to update&period;
| *x509*
| Signer certificate identifying the signing key&period;
| *pkey*
| Private key corresponding to `x509&period;`
| *dgst*
| Message digest algorithm used for signing&period;
|===


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