EVP_PKEY_IS_A - Online Linux Manual PageSection : 3ossl
Updated : 2022-03-15
Source : 3.0.2
Note : OpenSSL

NAMEEVP_PKEY_is_a, EVP_PKEY_can_sign, EVP_PKEY_type_names_do_all, EVP_PKEY_get0_type_name, EVP_PKEY_get0_description, EVP_PKEY_get0_provider ​− key type and capabilities functions

SYNOPSIS​ #include <openssl/evp.h> ​ ​ int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name); ​ int EVP_PKEY_can_sign(const EVP_PKEY *pkey); ​ int EVP_PKEY_type_names_do_all(const EVP_PKEY *pkey, ​ void (*fn)(const char *name, void *data), ​ void *data); ​ const char *EVP_PKEY_get0_type_name(const EVP_PKEY *key); ​ const char *EVP_PKEY_get0_description(const EVP_PKEY *key); ​ const OSSL_PROVIDER *EVP_PKEY_get0_provider(const EVP_PKEY *key);

DESCRIPTIONEVP_PKEY_is_a() checks if the key type of pkey is name. EVP_PKEY_can_sign() checks if the functionality for the key type of ​pkey supports signing. No other check is done, such as whether ​pkey contains a private key. EVP_PKEY_type_names_do_all() traverses all names for pkey's key type, and calls fn with each name and data. For example, an RSA EVP_PKEY may be named both RSA and rsaEncryption. The order of the names depends on the provider implementation that holds the key. EVP_PKEY_get0_type_name() returns the first key type name that is found for the given pkey. Note that the pkey may have multiple synonyms associated with it. In this case it depends on the provider implementation that holds the key which one will be returned. Ownership of the returned string is retained by the pkey object and should not be freed by the caller. EVP_PKEY_get0_description() returns a description of the type of EVP_PKEY, meant for display and human consumption. The description is at the discretion of the key type implementation. EVP_PKEY_get0_provider() returns the provider of the EVP_PKEY's ​EVP_KEYMGMT(3).

RETURN VALUESEVP_PKEY_is_a() returns 1 if pkey has the key type name, otherwise 0. EVP_PKEY_can_sign() returns 1 if the pkey key type functionality supports signing, otherwise 0. EVP_PKEY_get0_type_name() returns the name that is found or NULL on error. EVP_PKEY_get0_description() returns the description if found or NULL if not. EVP_PKEY_get0_provider() returns the provider if found or NULL if not. EVP_PKEY_type_names_do_all() returns 1 if the callback was called for all names. A return value of 0 means that the callback was not called for any names.

EXAMPLES

EVP_PKEY_is_a()The loaded providers and what key types they support will ultimately determine what name is possible to use with EVP_PKEY_is_a(). We do know that the default provider supports RSA, DH, DSA and EC keys, so we can use this as an crude example: ​ #include <openssl/evp.h> ​ ​ ... ​ /* |pkey| is an EVP_PKEY* */ ​ if (EVP_PKEY_is_a(pkey, "RSA")) { ​ BIGNUM *modulus = NULL; ​ if (EVP_PKEY_get_bn_param(pkey, "n", &modulus)) ​ /* do whatever with the modulus */ ​ BN_free(modulus); ​ }

EVP_PKEY_can_sign()​ #include <openssl/evp.h> ​ ​ ... ​ /* |pkey| is an EVP_PKEY* */ ​ if (!EVP_PKEY_can_sign(pkey)) { ​ fprintf(stderr, "Not a signing key!"); ​ exit(1); ​ } ​ /* Sign something... */

HISTORYThe functions described here were added in OpenSSL 3.0.

COPYRIGHTCopyright 2020−2021 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the License). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
0
Johanes Gumabo
Data Size   :   13,877 byte
man-EVP_PKEY_can_sign.3osslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 189,032
Visitor ID   :     :  
Visitor IP   :   18.117.192.205   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|E___VP_PKEY_can_sign.3ossl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|E___VP_PKEY_can_sign.3ossl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|E___VP_PKEY_can_sign.3ossl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|E___VP_PKEY_can_sign.3ossl|43|'br══─}─══ |'br══─}─══ )