[#ASN1_sign]
= ASN1&lowbar;sign
:mrdocs:

Sign ASN&period;1 data described by an i2d encoder using `pkey` (deprecated)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;deprecated&rsqb;&rsqb;
int
ASN1&lowbar;sign(
    xref:i2d_of_void.adoc[i2d&lowbar;of&lowbar;void]* i2d,
    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,
    char* data,
    xref:EVP_PKEY.adoc[EVP&lowbar;PKEY]* pkey,
    xref:EVP_MD.adoc[EVP&lowbar;MD] const* type);
----

[WARNING]
====
https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged.
====
== Return Value

* Signature length in bytes on success, or 0 on failure&period;
* Signature length in bytes on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *i2d*
| Encoder that serializes `data` into DER for hashing&period;
| *algor1*
| Optional AlgorithmIdentifier updated with the signature algorithm, or NULL&period;
| *algor2*
| Optional second AlgorithmIdentifier updated similarly, or NULL&period;
| *signature*
| Output BIT STRING that receives the signature bits&period;
| *data*
| Structure passed to `i2d&period;`
| *pkey*
| Private key used for signing&period;
| *type*
| Digest algorithm used to hash the DER encoding&period;
|===


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