[#EVP_PKEY_decrypt]
= EVP&lowbar;PKEY&lowbar;decrypt
:mrdocs:

Decrypt data using the private key bound to `ctx&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PKEY&lowbar;decrypt(
    xref:EVP_PKEY_CTX.adoc[EVP&lowbar;PKEY&lowbar;CTX]* ctx,
    unsigned char* out,
    size&lowbar;t* outlen,
    unsigned char const* in,
    size&lowbar;t inlen);
----

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| Context previously initialized with EVP&lowbar;PKEY&lowbar;decrypt&lowbar;init()&period;
| *out*
| Buffer receiving plaintext, or NULL to query the required size&period;
| *outlen*
| In&sol;out length of `out&semi;` on return holds bytes written or needed&period;
| *in*
| Ciphertext bytes to decrypt&period;
| *inlen*
| Length of `in` in bytes&period;
|===


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