1EVP_PKEY_SET_TYPE(3ossl)            OpenSSL           EVP_PKEY_SET_TYPE(3ossl)
2
3
4

NAME

6       EVP_PKEY_set_type, EVP_PKEY_set_type_str, EVP_PKEY_set_type_by_keymgmt
7       - functions to change the EVP_PKEY type
8

SYNOPSIS

10        #include <openssl/evp.h>
11
12        int EVP_PKEY_set_type(EVP_PKEY *pkey, int type);
13        int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);
14        int EVP_PKEY_set_type_by_keymgmt(EVP_PKEY *pkey, EVP_KEYMGMT *keymgmt);
15

DESCRIPTION

17       All the functions described here behave the same in so far that they
18       clear all the previous key data and methods from pkey, and reset it to
19       be of the type of key given by the different arguments.  If pkey is
20       NULL, these functions will still return the same return values as if it
21       wasn't.
22
23       EVP_PKEY_set_type() initialises pkey to contain an internal legacy key.
24       When doing this, it finds a EVP_PKEY_ASN1_METHOD(3) corresponding to
25       type, and associates pkey with the findings.  It is an error if no
26       EVP_PKEY_ASN1_METHOD(3) could be found for type.
27
28       EVP_PKEY_set_type_str() initialises pkey to contain an internal legacy
29       key. When doing this, it finds a EVP_PKEY_ASN1_METHOD(3) corresponding
30       to str that has then length len, and associates pkey with the findings.
31       It is an error if no EVP_PKEY_ASN1_METHOD(3) could be found for type.
32
33       For both EVP_PKEY_set_type() and EVP_PKEY_set_type_str(), pkey gets a
34       numeric type, which can be retrieved with EVP_PKEY_get_id(3).  This
35       numeric type is taken from the EVP_PKEY_ASN1_METHOD(3) that was found,
36       and is equal to or closely related to type in the case of
37       EVP_PKEY_set_type(), or related to str in the case of
38       EVP_PKEY_set_type_str().
39
40       EVP_PKEY_set_type_by_keymgmt() initialises pkey to contain an internal
41       provider side key.  When doing this, it associates pkey with keymgmt.
42       For keys initialised like this, the numeric type retrieved with
43       EVP_PKEY_get_id(3) will always be EVP_PKEY_NONE.
44

RETURN VALUES

46       All functions described here return 1 if successful, or 0 on error.
47

SEE ALSO

49       EVP_PKEY_assign(3), EVP_PKEY_get_id(3), EVP_PKEY_get0_RSA(3),
50       EVP_PKEY_copy_parameters(3), EVP_PKEY_ASN1_METHOD(3), EVP_KEYMGMT(3)
51
53       Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
54
55       Licensed under the Apache License 2.0 (the "License").  You may not use
56       this file except in compliance with the License.  You can obtain a copy
57       in the file LICENSE in the source distribution or at
58       <https://www.openssl.org/source/license.html>.
59
60
61
623.0.5                             2022-11-01          EVP_PKEY_SET_TYPE(3ossl)
Impressum