PEM_read_bio_RSAPublicKey equivalent API which returns EVP_PKEY

Richard Levitte levitte at openssl.org
Mon Apr 12 16:34:51 UTC 2021


On Mon, 12 Apr 2021 06:24:32 +0200,
Paramashivaiah, Sunil wrote:
> 
> But, I couldn't find equivallent API to replace "PEM_read_bio_RSAPublicKey" to get EVP_PKEY for 
> creating EVP ctx(EVP_PKEY_CTX_new) to use in "EVP_PKEY_encrypt" and "EVP_PKEY_decrypt".

I believe that one of these functions would help you:

EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);

EVP_PKEY_CTX *EVP_PKEY_CTX_new_from_pkey(OSSL_LIB_CTX *libctx,
                                         EVP_PKEY *pkey, const char *propquery);

Cheers,
Richard

-- 
Richard Levitte         levitte at openssl.org
OpenSSL Project         http://www.openssl.org/~levitte/


More information about the openssl-users mailing list