[#RSA_public_encrypt] = RSA_public_encrypt :mrdocs: Encrypt `flen` bytes from `from` with RSA public key `rsa` (deprecated). == Synopsis Declared in `<openssl/rsa.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated]] int RSA_public_encrypt( int flen, unsigned char const* from, unsigned char* to, xref:RSA.adoc[RSA]* rsa, int padding); ---- [WARNING] ==== https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged. ==== == Return Value Number of ciphertext bytes written to `to,` or a negative value on error. == Parameters [cols="1,4"] |=== | Name| Description | *flen* | Length of `from` in bytes. | *from* | Plaintext bytes to encrypt (often a session key). | *to* | Output buffer of at least RSA_size(`rsa)` bytes. | *rsa* | RSA public key. | *padding* | Padding mode such as RSA_PKCS1_PADDING or RSA_PKCS1_OAEP_PADDING. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#