[#ASN1_item_sign]
= ASN1&lowbar;item&lowbar;sign
:mrdocs:

Sign the DER encoding of an ASN&period;1 value described by `it&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
ASN1&lowbar;item&lowbar;sign(
    xref:ASN1_ITEM.adoc[ASN1&lowbar;ITEM] const* it,
    xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]* algor1,
    xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]* algor2,
    xref:ASN1_BIT_STRING.adoc[ASN1&lowbar;BIT&lowbar;STRING]* signature,
    void const* data,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* md);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *it*
| ASN&period;1 item descriptor for `data&period;`
| *algor1*
| Optional AlgorithmIdentifier to set for the signature algorithm, or NULL&period;
| *algor2*
| Optional second AlgorithmIdentifier to set (for example in certificates), or NULL&period;
| *signature*
| Destination BIT STRING that receives the signature bits&period;
| *data*
| Object to encode with `it` and sign&period;
| *pkey*
| Private key used for signing&period;
| *md*
| Message digest, or NULL to use a key&hyphen;type default where applicable&period;
|===


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