[#EVP_PKEY_encrypt] = EVP_PKEY_encrypt :mrdocs: Encrypt data with a public key using a context from EVP_PKEY_encrypt_init(). == Synopsis Declared in `<openssl/evp.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int EVP_PKEY_encrypt( xref:EVP_PKEY_CTX.adoc[EVP_PKEY_CTX]* ctx, unsigned char* out, size_t* outlen, unsigned char const* in, size_t inlen); ---- == Return Value 1 on success, or a non‐positive value on failure. == Parameters [cols="1,4"] |=== | Name| Description | *ctx* | Encryption context holding the public key. | *out* | Output buffer for ciphertext, or NULL to query the required size via `outlen.` | *outlen* | On entry, capacity of `out` when non‐NULL; on return, bytes written or required. | *in* | Plaintext bytes to encrypt. | *inlen* | Length of `in` in bytes. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#