EVP_PKEY_new.pod 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_new, EVP_PKEY_up_ref, EVP_PKEY_free - private key allocation functions
  4. =head1 SYNOPSIS
  5. #include <openssl/evp.h>
  6. EVP_PKEY *EVP_PKEY_new(void);
  7. int EVP_PKEY_up_ref(EVP_PKEY *key);
  8. void EVP_PKEY_free(EVP_PKEY *key);
  9. =head1 DESCRIPTION
  10. The EVP_PKEY_new() function allocates an empty B<EVP_PKEY> structure which is
  11. used by OpenSSL to store private keys. The reference count is set to B<1>.
  12. EVP_PKEY_up_ref() increments the reference count of B<key>.
  13. EVP_PKEY_free() decrements the reference count of B<key> and, if the reference
  14. count is zero, frees it up. If B<key> is NULL, nothing is done.
  15. =head1 NOTES
  16. The B<EVP_PKEY> structure is used by various OpenSSL functions which require a
  17. general private key without reference to any particular algorithm.
  18. The structure returned by EVP_PKEY_new() is empty. To add a private key to this
  19. empty structure the functions described in L<EVP_PKEY_set1_RSA(3)> should be
  20. used.
  21. =head1 RETURN VALUES
  22. EVP_PKEY_new() returns either the newly allocated B<EVP_PKEY> structure or
  23. B<NULL> if an error occurred.
  24. EVP_PKEY_up_ref() returns 1 for success and 0 for failure.
  25. =head1 SEE ALSO
  26. L<EVP_PKEY_set1_RSA(3)>
  27. =head1 HISTORY
  28. EVP_PKEY_new() and EVP_PKEY_free() exist in all versions of OpenSSL.
  29. EVP_PKEY_up_ref() was first added to OpenSSL 1.1.0.
  30. =head1 COPYRIGHT
  31. Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
  32. Licensed under the OpenSSL license (the "License"). You may not use
  33. this file except in compliance with the License. You can obtain a copy
  34. in the file LICENSE in the source distribution or at
  35. L<https://www.openssl.org/source/license.html>.
  36. =cut