EVP_PKEY_CTX_new.pod 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_provided,
  4. EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
  5. - public key algorithm context functions
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
  9. EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
  10. EVP_PKEY_CTX *EVP_PKEY_CTX_new_provided(OPENSSL_CTX *libctx,
  11. const char *name,
  12. const char *propquery);
  13. EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
  14. void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
  15. =head1 DESCRIPTION
  16. The EVP_PKEY_CTX_new() function allocates public key algorithm context using
  17. the algorithm specified in I<pkey> and ENGINE I<e>.
  18. The EVP_PKEY_CTX_new_id() function allocates public key algorithm context
  19. using the algorithm specified by I<id> and ENGINE I<e>.
  20. The EVP_PKEY_CTX_new_provided() function allocates a public key algorithm
  21. context using the library context I<libctx> (see L<OPENSSL_CTX(3)>), the
  22. algorithm specified by I<name> and the property query I<propquery>. None
  23. of the arguments are duplicated, so they must remain unchanged for the
  24. lifetime of the returned B<EVP_PKEY_CTX> or of any of its duplicates.
  25. EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_provided() are normally
  26. used when no B<EVP_PKEY> structure is associated with the operations,
  27. for example during parameter generation or key generation for some
  28. algorithms.
  29. EVP_PKEY_CTX_dup() duplicates the context I<ctx>.
  30. EVP_PKEY_CTX_free() frees up the context I<ctx>.
  31. If I<ctx> is NULL, nothing is done.
  32. =head1 NOTES
  33. The B<EVP_PKEY_CTX> structure is an opaque public key algorithm context used
  34. by the OpenSSL high level public key API. Contexts B<MUST NOT> be shared between
  35. threads: that is it is not permissible to use the same context simultaneously
  36. in two threads.
  37. =head1 RETURN VALUES
  38. EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() returns either
  39. the newly allocated B<EVP_PKEY_CTX> structure of B<NULL> if an error occurred.
  40. EVP_PKEY_CTX_free() does not return a value.
  41. =head1 SEE ALSO
  42. L<EVP_PKEY_new(3)>
  43. =head1 HISTORY
  44. These functions were added in OpenSSL 1.0.0.
  45. =head1 COPYRIGHT
  46. Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
  47. Licensed under the Apache License 2.0 (the "License"). You may not use
  48. this file except in compliance with the License. You can obtain a copy
  49. in the file LICENSE in the source distribution or at
  50. L<https://www.openssl.org/source/license.html>.
  51. =cut