From 140eee2b3b3090107aea2d09ab10eb737fb1e5bb Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 9 Oct 2020 13:02:58 +0200 Subject: Add easy to digest selector macros for EVP_PKEYs These are meant to be used with functions like OSSL_ENCODER_CTX_new_by_EVP_PKEY() The OSSL_ENCODER_CTX_new_by_EVP_PKEY() manual is also expanded on the topics of output types and selections. Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/13189) --- include/openssl/evp.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/openssl/evp.h b/include/openssl/evp.h index 4472bcf50e..ba13960d6a 100644 --- a/include/openssl/evp.h +++ b/include/openssl/evp.h @@ -75,6 +75,14 @@ /* Special indicator that the object is uniquely provider side */ # define EVP_PKEY_KEYMGMT -1 +/* Easy to use macros for EVP_PKEY related selections */ +# define EVP_PKEY_KEY_PARAMETERS \ + ( OSSL_KEYMGMT_SELECT_ALL_PARAMETERS ) +# define EVP_PKEY_PUBLIC_KEY \ + ( EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY ) +# define EVP_PKEY_KEYPAIR \ + ( EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY ) + #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3