const char *sig_name = NULL;
if (!out_bin) {
if (sigkey != NULL)
- sig_name = EVP_PKEY_get0_first_alg_name(sigkey);
+ sig_name = EVP_PKEY_get0_type_name(sigkey);
}
ret = 0;
for (i = 0; i < argc; i++) {
OSSL_TRACE_BEGIN(ENCODER) {
BIO_printf(trc_out,
"(ctx %p) Looking for %s encoders with selection %d\n",
- (void *)ctx, EVP_PKEY_get0_first_alg_name(pkey), selection);
+ (void *)ctx, EVP_PKEY_get0_type_name(pkey), selection);
BIO_printf(trc_out, " output type: %s, output structure: %s\n",
output_type, output_struct);
} OSSL_TRACE_END(ENCODER);
return 0;
}
-const char *EVP_PKEY_get0_first_alg_name(const EVP_PKEY *key)
+const char *EVP_PKEY_get0_type_name(const EVP_PKEY *key)
{
const EVP_PKEY_ASN1_METHOD *ameth;
const char *name = NULL;
return EVP_KEYMGMT_is_a(pkey->keymgmt, name);
}
-int EVP_PKEY_typenames_do_all(const EVP_PKEY *pkey,
- void (*fn)(const char *name, void *data),
- void *data)
+int EVP_PKEY_type_names_do_all(const EVP_PKEY *pkey,
+ void (*fn)(const char *name, void *data),
+ void *data)
{
if (!evp_pkey_is_typed(pkey))
return 0;
=head1 NAME
-EVP_PKEY_is_a, EVP_PKEY_can_sign, EVP_PKEY_typenames_do_all,
-EVP_PKEY_get0_first_alg_name
+EVP_PKEY_is_a, EVP_PKEY_can_sign, EVP_PKEY_type_names_do_all,
+EVP_PKEY_get0_type_name
- key type and capabilities functions
=head1 SYNOPSIS
int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name);
int EVP_PKEY_can_sign(const EVP_PKEY *pkey);
- int EVP_PKEY_typenames_do_all(const EVP_PKEY *pkey,
- void (*fn)(const char *name, void *data),
- void *data);
- const char *EVP_PKEY_get0_first_alg_name(const EVP_PKEY *key);
+ 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);
=head1 DESCRIPTION
I<pkey> supports signing. No other check is done, such as whether
I<pkey> contains a private key.
-EVP_PKEY_typenames_do_all() traverses all names for I<pkey>'s key type, and
+EVP_PKEY_type_names_do_all() traverses all names for I<pkey>'s key type, and
calls I<fn> with each name and I<data>. For example, an RSA B<EVP_PKEY> may
be named both C<RSA> and C<rsaEncryption>.
-The order of the names is undefined.
+The order of the names depends on the provider implementation that holds
+the key.
-EVP_PKEY_get0_first_alg_name() returns the first algorithm name that is found
+EVP_PKEY_get0_type_name() returns the first key type name that is found
for the given I<pkey>. Note that the I<pkey> may have multiple synonyms
-associated with it. In this case it is undefined which one will be returned.
+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 I<pkey> object and should
not be freed by the caller.
EVP_PKEY_can_sign() returns 1 if the I<pkey> key type functionality
supports signing, otherwise 0.
-EVP_PKEY_get0_first_alg_name() returns the name that is found or NULL on error.
+EVP_PKEY_get0_type_name() returns the name that is found or NULL on error.
-EVP_PKEY_typenames_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.
+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.
=head1 EXAMPLES
int key_len, EVP_PKEY *pub_key);
#endif
int EVP_PKEY_is_a(const EVP_PKEY *pkey, const char *name);
-int EVP_PKEY_typenames_do_all(const EVP_PKEY *pkey,
- void (*fn)(const char *name, void *data),
- void *data);
+int EVP_PKEY_type_names_do_all(const EVP_PKEY *pkey,
+ void (*fn)(const char *name, void *data),
+ void *data);
int EVP_PKEY_type(int type);
int EVP_PKEY_id(const EVP_PKEY *pkey);
int EVP_PKEY_base_id(const EVP_PKEY *pkey);
int EVP_PKEY_CTX_set_kem_op(EVP_PKEY_CTX *ctx, const char *op);
-const char *EVP_PKEY_get0_first_alg_name(const EVP_PKEY *key);
+const char *EVP_PKEY_get0_type_name(const EVP_PKEY *key);
# define EVP_PKEY_OP_UNDEFINED 0
# define EVP_PKEY_OP_PARAMGEN (1<<1)
ca_filename, ee_filename);
TEST_info("Signature algorithm is %s (pkey type %s, hash type %s)",
OBJ_nid2sn(sig_nid), OBJ_nid2sn(pkey_nid), OBJ_nid2sn(dig_nid));
- TEST_info("Pkey key type is %s", EVP_PKEY_get0_first_alg_name(pkey));
+ TEST_info("Pkey key type is %s", EVP_PKEY_get0_type_name(pkey));
goto end;
}
if (TEST_FL_ptr(pkey)) {
if (!(ok = TEST_FL_true(EVP_PKEY_is_a(pkey, type)))) {
- EVP_PKEY_typenames_do_all(pkey, collect_name, &namelist);
+ EVP_PKEY_type_names_do_all(pkey, collect_name, &namelist);
if (namelist != NULL)
TEST_note("%s isn't any of %s", type, namelist);
OPENSSL_free(namelist);
CMS_AuthEnvelopedData_create ? 3_0_0 EXIST::FUNCTION:CMS
CMS_AuthEnvelopedData_create_ex ? 3_0_0 EXIST::FUNCTION:CMS
EVP_PKEY_CTX_set_ec_param_enc ? 3_0_0 EXIST::FUNCTION:
-EVP_PKEY_get0_first_alg_name ? 3_0_0 EXIST::FUNCTION:
+EVP_PKEY_get0_type_name ? 3_0_0 EXIST::FUNCTION:
EVP_KEYMGMT_get0_first_name ? 3_0_0 EXIST::FUNCTION:
EC_KEY_decoded_from_explicit_params ? 3_0_0 EXIST::FUNCTION:DEPRECATEDIN_3_0,EC
EVP_KEM_free ? 3_0_0 EXIST::FUNCTION:
OSSL_ENCODER_CTX_set_construct_data ? 3_0_0 EXIST::FUNCTION:
OSSL_ENCODER_CTX_set_cleanup ? 3_0_0 EXIST::FUNCTION:
OSSL_ENCODER_CTX_set_passphrase_cb ? 3_0_0 EXIST::FUNCTION:
-EVP_PKEY_typenames_do_all ? 3_0_0 EXIST::FUNCTION:
+EVP_PKEY_type_names_do_all ? 3_0_0 EXIST::FUNCTION:
OSSL_DECODER_INSTANCE_get_input_type ? 3_0_0 EXIST::FUNCTION:
EVP_ASYM_CIPHER_gettable_ctx_params ? 3_0_0 EXIST::FUNCTION:
EVP_ASYM_CIPHER_settable_ctx_params ? 3_0_0 EXIST::FUNCTION: