Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the type of an EVP_PKEY?

Tags:

openssl

In an old program we have a line of code like below:

EVP_PKEY *pKey;
/*
.
.
*/
if (pkey->type == EVP_PKEY_RSA)
    doSomething();

But in newer versions of OpenSSL the access to internal implementation of EVP_PKEY is banned. I could not find any function to replace above implementation. Any idea?

like image 706
E. Vakili Avatar asked Dec 12 '16 09:12

E. Vakili


1 Answers

I found the answer on OpenSSL Github issue list:

EVP_PKEY_id() returns the type field.

like image 127
E. Vakili Avatar answered Nov 10 '22 18:11

E. Vakili