From: Matt Caswell Date: Sat, 6 Sep 2014 22:47:55 +0000 (+0100) Subject: Updates to EVP_PKEY_encrypt.pod submitted by user Bernardh via the wiki X-Git-Tag: OpenSSL_1_0_2~174 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8f8e7cec835625a7e54a106d3b589c800402af3b;p=oweals%2Fopenssl.git Updates to EVP_PKEY_encrypt.pod submitted by user Bernardh via the wiki Minor changes made by Matt Caswell. Reviewed-by: Dr. Stephen Henson (cherry picked from commit 34890ac18eb5ee7bffe9d460480164e1546b491e) --- diff --git a/doc/crypto/EVP_PKEY_encrypt.pod b/doc/crypto/EVP_PKEY_encrypt.pod index e495a81242..6799ce1010 100644 --- a/doc/crypto/EVP_PKEY_encrypt.pod +++ b/doc/crypto/EVP_PKEY_encrypt.pod @@ -43,19 +43,23 @@ indicates the operation is not supported by the public key algorithm. =head1 EXAMPLE -Encrypt data using OAEP (for RSA keys): +Encrypt data using OAEP (for RSA keys). See also L or +L for means to load a public key. You may also simply +set 'eng = NULL;' to start with the default OpenSSL RSA implementation: #include #include + #include EVP_PKEY_CTX *ctx; + ENGINE *eng; unsigned char *out, *in; size_t outlen, inlen; EVP_PKEY *key; - /* NB: assumes key in, inlen are already set up + /* NB: assumes eng, key, in, inlen are already set up, * and that key is an RSA public key */ - ctx = EVP_PKEY_CTX_new(key); + ctx = EVP_PKEY_CTX_new(key,eng); if (!ctx) /* Error occurred */ if (EVP_PKEY_encrypt_init(ctx) <= 0) @@ -79,6 +83,8 @@ Encrypt data using OAEP (for RSA keys): =head1 SEE ALSO +L, +L, L, L, L,