E. Vakili
E. Vakili

Reputation: 1096

How to get the type of an EVP_PKEY?

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?

Upvotes: 10

Views: 7609

Answers (1)

E. Vakili
E. Vakili

Reputation: 1096

I found the answer on OpenSSL Github issue list:

EVP_PKEY_id() returns the type field.

Upvotes: 13

Related Questions