Checking if an EVP_PKEY* contains a private key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OpenSSL has the higher-level EVP_PKEY_* functions which work abstracts the public key cryptography algorithms.  However, sometimes a EVP_PKEY* only has a public key.  How could I check if a given EVP_PKEY* contains a private key?  I could use EVP_PKEY_decrypt_init and see if it returns an error, but that seems to be quite heavy-handed for what seems to be a simple check.  The other option is to go through the EVP_PKEY_get0_* functions and investigate the underlying mechanism directly (e.g. EVP_PKEY_get0_RSA and checking the RSA*'s private exponent is NULL), but that is also clumsy as I'll have to write code for every possible algorithm.

Thanks
Stephen
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20151221/140ee1ad/attachment.html>


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux