1109998Smarkm=pod 2109998Smarkm 3109998Smarkm=head1 NAME 4109998Smarkm 5109998SmarkmEVP_PKEY_set1_RSA, EVP_PKEY_set1_DSA, EVP_PKEY_set1_DH, EVP_PKEY_set1_EC_KEY, 6109998SmarkmEVP_PKEY_get1_RSA, EVP_PKEY_get1_DSA, EVP_PKEY_get1_DH, EVP_PKEY_get1_EC_KEY, 7109998SmarkmEVP_PKEY_assign_RSA, EVP_PKEY_assign_DSA, EVP_PKEY_assign_DH, EVP_PKEY_assign_EC_KEY, 8109998SmarkmEVP_PKEY_type - EVP_PKEY assignment functions. 9109998Smarkm 10109998Smarkm=head1 SYNOPSIS 11109998Smarkm 12109998Smarkm #include <openssl/evp.h> 13109998Smarkm 14109998Smarkm int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key); 15109998Smarkm int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key); 16109998Smarkm int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key); 17109998Smarkm int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,EC_KEY *key); 18109998Smarkm 19109998Smarkm RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); 20109998Smarkm DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); 21109998Smarkm DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey); 22109998Smarkm EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); 23109998Smarkm 24109998Smarkm int EVP_PKEY_assign_RSA(EVP_PKEY *pkey,RSA *key); 25109998Smarkm int EVP_PKEY_assign_DSA(EVP_PKEY *pkey,DSA *key); 26109998Smarkm int EVP_PKEY_assign_DH(EVP_PKEY *pkey,DH *key); 27109998Smarkm int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey,EC_KEY *key); 28109998Smarkm 29109998Smarkm int EVP_PKEY_type(int type); 30109998Smarkm 31109998Smarkm=head1 DESCRIPTION 32109998Smarkm 33109998SmarkmEVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and 34109998SmarkmEVP_PKEY_set1_EC_KEY() set the key referenced by B<pkey> to B<key>. 35109998Smarkm 36109998SmarkmEVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and 37109998SmarkmEVP_PKEY_get1_EC_KEY() return the referenced key in B<pkey> or 38109998SmarkmB<NULL> if the key is not of the correct type. 39109998Smarkm 40273399SdelphijEVP_PKEY_assign_RSA(), EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() 41109998Smarkmand EVP_PKEY_assign_EC_KEY() also set the referenced key to B<key> 42109998Smarkmhowever these use the supplied B<key> internally and so B<key> 43109998Smarkmwill be freed when the parent B<pkey> is freed. 44109998Smarkm 45109998SmarkmEVP_PKEY_type() returns the type of key corresponding to the value 46109998SmarkmB<type>. The type of a key can be obtained with 47109998SmarkmEVP_PKEY_type(pkey->type). The return value will be EVP_PKEY_RSA, 48109998SmarkmEVP_PKEY_DSA, EVP_PKEY_DH or EVP_PKEY_EC for the corresponding 49109998Smarkmkey types or NID_undef if the key type is unassigned. 50109998Smarkm 51109998Smarkm=head1 NOTES 52109998Smarkm 53109998SmarkmIn accordance with the OpenSSL naming convention the key obtained 54109998Smarkmfrom or assigned to the B<pkey> using the B<1> functions must be 55109998Smarkmfreed as well as B<pkey>. 56109998Smarkm 57273399SdelphijEVP_PKEY_assign_RSA(), EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() 58273399Sdelphijand EVP_PKEY_assign_EC_KEY() are implemented as macros. 59109998Smarkm 60109998Smarkm=head1 RETURN VALUES 61109998Smarkm 62109998SmarkmEVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and 63109998SmarkmEVP_PKEY_set1_EC_KEY() return 1 for success or 0 for failure. 64109998Smarkm 65109998SmarkmEVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and 66109998SmarkmEVP_PKEY_get1_EC_KEY() return the referenced key or B<NULL> if 67109998Smarkman error occurred. 68109998Smarkm 69273399SdelphijEVP_PKEY_assign_RSA(), EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH() 70109998Smarkmand EVP_PKEY_assign_EC_KEY() return 1 for success and 0 for failure. 71109998Smarkm 72109998Smarkm=head1 SEE ALSO 73109998Smarkm 74109998SmarkmL<EVP_PKEY_new(3)|EVP_PKEY_new(3)> 75109998Smarkm 76109998Smarkm=head1 HISTORY 77109998Smarkm 78109998SmarkmTBA 79109998Smarkm 80109998Smarkm=cut 81