EVP_PKEY-X25519.7ossl 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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_PKEY-X25519 7ossl"
  58. .TH EVP_PKEY-X25519 7ossl 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_PKEY\-X25519, EVP_PKEY\-X448, EVP_PKEY\-ED25519, EVP_PKEY\-ED448,
  65. EVP_KEYMGMT\-X25519, EVP_KEYMGMT\-X448, EVP_KEYMGMT\-ED25519, EVP_KEYMGMT\-ED448
  66. \&\- EVP_PKEY X25519, X448, ED25519 and ED448 keytype and algorithm support
  67. .SH DESCRIPTION
  68. .IX Header "DESCRIPTION"
  69. The \fBX25519\fR, \fBX448\fR, \fBED25519\fR and \fBED448\fR keytypes are
  70. implemented in OpenSSL's default and FIPS providers. These implementations
  71. support the associated key, containing the public key \fIpub\fR and the
  72. private key \fIpriv\fR.
  73. .SS "Keygen Parameters"
  74. .IX Subsection "Keygen Parameters"
  75. .IP """dhkem-ikm"" (\fBOSSL_PKEY_PARAM_DHKEM_IKM\fR) <octet string>" 4
  76. .IX Item """dhkem-ikm"" (OSSL_PKEY_PARAM_DHKEM_IKM) <octet string>"
  77. DHKEM requires the generation of a keypair using an input key material (seed).
  78. Use this to specify the key material used for generation of the private key.
  79. This value should not be reused for other purposes.
  80. It should have a length of at least 32 for X25519, and 56 for X448.
  81. This is only supported by X25519 and X448.
  82. .IP """fips-indicator"" (\fBOSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR\fR) <integer>" 4
  83. .IX Item """fips-indicator"" (OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR) <integer>"
  84. This getter is only supported by X25519 and X448 for the FIPS provider.
  85. Since X25519 and X448 are unapproved in FIPS 140\-3 this getter return 0.
  86. .Sp
  87. See "Common Information Parameters" in \fBprovider\-keymgmt\fR\|(7) for further information.
  88. .PP
  89. Use \fBEVP_PKEY_CTX_set_params()\fR after calling \fBEVP_PKEY_keygen_init()\fR.
  90. .SS "Common X25519, X448, ED25519 and ED448 parameters"
  91. .IX Subsection "Common X25519, X448, ED25519 and ED448 parameters"
  92. In addition to the common parameters that all keytypes should support (see
  93. "Common parameters" in \fBprovider\-keymgmt\fR\|(7)), the implementation of these keytypes
  94. support the following.
  95. .IP """group"" (\fBOSSL_PKEY_PARAM_GROUP_NAME\fR) <UTF8 string>" 4
  96. .IX Item """group"" (OSSL_PKEY_PARAM_GROUP_NAME) <UTF8 string>"
  97. This is only supported by X25519 and X448. The group name must be "x25519" or
  98. "x448" respectively for those algorithms. This is only present for consistency
  99. with other key exchange algorithms and is typically not needed.
  100. .IP """pub"" (\fBOSSL_PKEY_PARAM_PUB_KEY\fR) <octet string>" 4
  101. .IX Item """pub"" (OSSL_PKEY_PARAM_PUB_KEY) <octet string>"
  102. The public key value.
  103. .IP """priv"" (\fBOSSL_PKEY_PARAM_PRIV_KEY\fR) <octet string>" 4
  104. .IX Item """priv"" (OSSL_PKEY_PARAM_PRIV_KEY) <octet string>"
  105. The private key value.
  106. .IP """encoded-pub-key"" (\fBOSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY\fR) <octet string>" 4
  107. .IX Item """encoded-pub-key"" (OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY) <octet string>"
  108. Used for getting and setting the encoding of a public key for the \fBX25519\fR and
  109. \&\fBX448\fR key types. Public keys are expected be encoded in a format as defined by
  110. RFC7748.
  111. .SS "ED25519 and ED448 parameters"
  112. .IX Subsection "ED25519 and ED448 parameters"
  113. .IP """mandatory-digest"" (\fBOSSL_PKEY_PARAM_MANDATORY_DIGEST\fR) <UTF8 string>" 4
  114. .IX Item """mandatory-digest"" (OSSL_PKEY_PARAM_MANDATORY_DIGEST) <UTF8 string>"
  115. The empty string, signifying that no digest may be specified.
  116. .SH "CONFORMING TO"
  117. .IX Header "CONFORMING TO"
  118. .IP "RFC 8032" 4
  119. .IX Item "RFC 8032"
  120. .PD 0
  121. .IP "RFC 8410" 4
  122. .IX Item "RFC 8410"
  123. .PD
  124. .SH EXAMPLES
  125. .IX Header "EXAMPLES"
  126. An \fBEVP_PKEY\fR context can be obtained by calling:
  127. .PP
  128. .Vb 2
  129. \& EVP_PKEY_CTX *pctx =
  130. \& EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
  131. \&
  132. \& EVP_PKEY_CTX *pctx =
  133. \& EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
  134. \&
  135. \& EVP_PKEY_CTX *pctx =
  136. \& EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
  137. \&
  138. \& EVP_PKEY_CTX *pctx =
  139. \& EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
  140. .Ve
  141. .PP
  142. An \fBX25519\fR key can be generated like this:
  143. .PP
  144. .Vb 1
  145. \& pkey = EVP_PKEY_Q_keygen(NULL, NULL, "X25519");
  146. .Ve
  147. .PP
  148. An \fBX448\fR, \fBED25519\fR, or \fBED448\fR key can be generated likewise.
  149. .SH "SEE ALSO"
  150. .IX Header "SEE ALSO"
  151. \&\fBEVP_KEYMGMT\fR\|(3), \fBEVP_PKEY\fR\|(3), \fBprovider\-keymgmt\fR\|(7),
  152. \&\fBEVP_KEYEXCH\-X25519\fR\|(7), \fBEVP_KEYEXCH\-X448\fR\|(7),
  153. \&\fBEVP_SIGNATURE\-ED25519\fR\|(7), \fBEVP_SIGNATURE\-ED448\fR\|(7)
  154. .SH COPYRIGHT
  155. .IX Header "COPYRIGHT"
  156. Copyright 2020\-2024 The OpenSSL Project Authors. All Rights Reserved.
  157. .PP
  158. Licensed under the Apache License 2.0 (the "License"). You may not use
  159. this file except in compliance with the License. You can obtain a copy
  160. in the file LICENSE in the source distribution or at
  161. <https://www.openssl.org/source/license.html>.