EVP_PKEY_set1_RSA.pod 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_set1_RSA, EVP_PKEY_set1_DSA, EVP_PKEY_set1_DH, EVP_PKEY_set1_EC_KEY,
  4. EVP_PKEY_get1_RSA, EVP_PKEY_get1_DSA, EVP_PKEY_get1_DH, EVP_PKEY_get1_EC_KEY,
  5. EVP_PKEY_assign_RSA, EVP_PKEY_assign_DSA, EVP_PKEY_assign_DH, EVP_PKEY_assign_EC_KEY,
  6. EVP_PKEY_type - EVP_PKEY assignment functions.
  7. =head1 SYNOPSIS
  8. #include <openssl/evp.h>
  9. int EVP_PKEY_set1_RSA(EVP_PKEY *pkey,RSA *key);
  10. int EVP_PKEY_set1_DSA(EVP_PKEY *pkey,DSA *key);
  11. int EVP_PKEY_set1_DH(EVP_PKEY *pkey,DH *key);
  12. int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey,EC_KEY *key);
  13. RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
  14. DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);
  15. DH *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
  16. EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);
  17. int EVP_PKEY_assign_RSA(EVP_PKEY *pkey,RSA *key);
  18. int EVP_PKEY_assign_DSA(EVP_PKEY *pkey,DSA *key);
  19. int EVP_PKEY_assign_DH(EVP_PKEY *pkey,DH *key);
  20. int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey,EC_KEY *key);
  21. int EVP_PKEY_type(int type);
  22. =head1 DESCRIPTION
  23. EVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and
  24. EVP_PKEY_set1_EC_KEY() set the key referenced by B<pkey> to B<key>.
  25. EVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and
  26. EVP_PKEY_get1_EC_KEY() return the referenced key in B<pkey> or
  27. B<NULL> if the key is not of the correct type.
  28. EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH()
  29. and EVP_PKEY_assign_EC_KEY() also set the referenced key to B<key>
  30. however these use the supplied B<key> internally and so B<key>
  31. will be freed when the parent B<pkey> is freed.
  32. EVP_PKEY_type() returns the type of key corresponding to the value
  33. B<type>. The type of a key can be obtained with
  34. EVP_PKEY_type(pkey->type). The return value will be EVP_PKEY_RSA,
  35. EVP_PKEY_DSA, EVP_PKEY_DH or EVP_PKEY_EC for the corresponding
  36. key types or NID_undef if the key type is unassigned.
  37. =head1 NOTES
  38. In accordance with the OpenSSL naming convention the key obtained
  39. from or assigned to the B<pkey> using the B<1> functions must be
  40. freed as well as B<pkey>.
  41. EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH()
  42. EVP_PKEY_assign_EC_KEY() are implemented as macros.
  43. =head1 RETURN VALUES
  44. EVP_PKEY_set1_RSA(), EVP_PKEY_set1_DSA(), EVP_PKEY_set1_DH() and
  45. EVP_PKEY_set1_EC_KEY() return 1 for success or 0 for failure.
  46. EVP_PKEY_get1_RSA(), EVP_PKEY_get1_DSA(), EVP_PKEY_get1_DH() and
  47. EVP_PKEY_get1_EC_KEY() return the referenced key or B<NULL> if
  48. an error occurred.
  49. EVP_PKEY_assign_RSA() EVP_PKEY_assign_DSA(), EVP_PKEY_assign_DH()
  50. and EVP_PKEY_assign_EC_KEY() return 1 for success and 0 for failure.
  51. =head1 SEE ALSO
  52. L<EVP_PKEY_new(3)|EVP_PKEY_new(3)>
  53. =head1 HISTORY
  54. TBA
  55. =cut