EVP_KEYEXCH_free.3ossl 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "EVP_KEYEXCH_FREE 3ossl"
  58. .TH EVP_KEYEXCH_FREE 3ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref,
  65. EVP_KEYEXCH_get0_provider, EVP_KEYEXCH_is_a, EVP_KEYEXCH_do_all_provided,
  66. EVP_KEYEXCH_names_do_all, EVP_KEYEXCH_get0_name, EVP_KEYEXCH_get0_description,
  67. EVP_KEYEXCH_gettable_ctx_params, EVP_KEYEXCH_settable_ctx_params
  68. \&\- Functions to manage EVP_KEYEXCH algorithm objects
  69. .SH SYNOPSIS
  70. .IX Header "SYNOPSIS"
  71. .Vb 1
  72. \& #include <openssl/evp.h>
  73. \&
  74. \& EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
  75. \& const char *properties);
  76. \& void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
  77. \& int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
  78. \& OSSL_PROVIDER *EVP_KEYEXCH_get0_provider(const EVP_KEYEXCH *exchange);
  79. \& int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name);
  80. \& const char *EVP_KEYEXCH_get0_name(const EVP_KEYEXCH *exchange);
  81. \& void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
  82. \& void (*fn)(EVP_KEYEXCH *exchange, void *arg),
  83. \& void *arg);
  84. \& int EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange,
  85. \& void (*fn)(const char *name, void *data),
  86. \& void *data);
  87. \& const char *EVP_KEYEXCH_get0_description(const EVP_KEYEXCH *keyexch);
  88. \& const OSSL_PARAM *EVP_KEYEXCH_gettable_ctx_params(const EVP_KEYEXCH *keyexch);
  89. \& const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch);
  90. .Ve
  91. .SH DESCRIPTION
  92. .IX Header "DESCRIPTION"
  93. \&\fBEVP_KEYEXCH_fetch()\fR fetches the key exchange implementation for the given
  94. \&\fIalgorithm\fR from any provider offering it, within the criteria given
  95. by the \fIproperties\fR.
  96. See "ALGORITHM FETCHING" in \fBcrypto\fR\|(7) for further information.
  97. .PP
  98. The returned value must eventually be freed with \fBEVP_KEYEXCH_free()\fR.
  99. .PP
  100. \&\fBEVP_KEYEXCH_free()\fR decrements the reference count for the \fBEVP_KEYEXCH\fR
  101. structure. Typically this structure will have been obtained from an earlier call
  102. to \fBEVP_KEYEXCH_fetch()\fR. If the reference count drops to 0 then the
  103. structure is freed. If the argument is NULL, nothing is done.
  104. .PP
  105. \&\fBEVP_KEYEXCH_up_ref()\fR increments the reference count for an \fBEVP_KEYEXCH\fR
  106. structure.
  107. .PP
  108. \&\fBEVP_KEYEXCH_get0_provider()\fR returns the provider that \fIexchange\fR was
  109. fetched from.
  110. .PP
  111. \&\fBEVP_KEYEXCH_is_a()\fR checks if \fIexchange\fR is an implementation of an
  112. algorithm that's identifiable with \fIname\fR.
  113. .PP
  114. \&\fBEVP_KEYEXCH_get0_name()\fR returns the algorithm name from the provided
  115. implementation for the given \fIexchange\fR. Note that the \fIexchange\fR may have
  116. multiple synonyms associated with it. In this case the first name from the
  117. algorithm definition is returned. Ownership of the returned string is retained
  118. by the \fIexchange\fR object and should not be freed by the caller.
  119. .PP
  120. \&\fBEVP_KEYEXCH_names_do_all()\fR traverses all names for the \fIexchange\fR, and
  121. calls \fIfn\fR with each name and \fIdata\fR.
  122. .PP
  123. \&\fBEVP_KEYEXCH_get0_description()\fR returns a description of the \fIkeyexch\fR, meant
  124. for display and human consumption. The description is at the discretion of
  125. the \fIkeyexch\fR implementation.
  126. .PP
  127. \&\fBEVP_KEYEXCH_do_all_provided()\fR traverses all key exchange implementations by
  128. all activated providers in the library context \fIlibctx\fR, and for each
  129. of the implementations, calls \fIfn\fR with the implementation method and
  130. \&\fIdata\fR as arguments.
  131. .PP
  132. \&\fBEVP_KEYEXCH_gettable_ctx_params()\fR and \fBEVP_KEYEXCH_settable_ctx_params()\fR return
  133. a constant \fBOSSL_PARAM\fR\|(3) array that describes the names and types of key
  134. parameters that can be retrieved or set by a key exchange algorithm using
  135. \&\fBEVP_PKEY_CTX_get_params\fR\|(3) and \fBEVP_PKEY_CTX_set_params\fR\|(3).
  136. .SH "RETURN VALUES"
  137. .IX Header "RETURN VALUES"
  138. \&\fBEVP_KEYEXCH_fetch()\fR returns a pointer to a \fBEVP_KEYEXCH\fR for success
  139. or NULL for failure.
  140. .PP
  141. \&\fBEVP_KEYEXCH_up_ref()\fR returns 1 for success or 0 otherwise.
  142. .PP
  143. \&\fBEVP_KEYEXCH_names_do_all()\fR returns 1 if the callback was called for all
  144. names. A return value of 0 means that the callback was not called for any names.
  145. .PP
  146. \&\fBEVP_KEYEXCH_is_a()\fR returns 1 of \fIexchange\fR was identifiable,
  147. otherwise 0.
  148. .PP
  149. \&\fBEVP_KEYEXCH_gettable_ctx_params()\fR and \fBEVP_KEYEXCH_settable_ctx_params()\fR return
  150. a constant \fBOSSL_PARAM\fR\|(3) array or NULL on error.
  151. .SH "SEE ALSO"
  152. .IX Header "SEE ALSO"
  153. "ALGORITHM FETCHING" in \fBcrypto\fR\|(7), \fBOSSL_PROVIDER\fR\|(3)
  154. .SH HISTORY
  155. .IX Header "HISTORY"
  156. The functions described here were added in OpenSSL 3.0.
  157. .SH COPYRIGHT
  158. .IX Header "COPYRIGHT"
  159. Copyright 2019\-2024 The OpenSSL Project Authors. All Rights Reserved.
  160. .PP
  161. Licensed under the Apache License 2.0 (the "License"). You may not use
  162. this file except in compliance with the License. You can obtain a copy
  163. in the file LICENSE in the source distribution or at
  164. <https://www.openssl.org/source/license.html>.