[#EVP_PKEY_sign]
= EVP&lowbar;PKEY&lowbar;sign
:mrdocs:

Create a signature over data using an initialized signing context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PKEY&lowbar;sign(
    xref:EVP_PKEY_CTX.adoc[EVP&lowbar;PKEY&lowbar;CTX]* ctx,
    unsigned char* sig,
    size&lowbar;t* siglen,
    unsigned char const* tbs,
    size&lowbar;t tbslen);
----

== Return Value

1 on success, 0 or a negative value on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Context previously prepared with EVP&lowbar;PKEY&lowbar;sign&lowbar;init() (and optional controls)&period;
| *sig*
| Output buffer for the signature, or NULL to only query the required length&period;
| *siglen*
| On entry, capacity of `sig` when non&hyphen;NULL&semi; on return, signature length in bytes&period;
| *tbs*
| Message or digest bytes to sign&period;
| *tbslen*
| Length of `tbs` in bytes&period;
|===


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