Add some missing OSSL_PKEY_PARAM_GROUP_NAME documentation
[oweals/openssl.git] / doc / man7 / EVP_PKEY-X25519.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_PKEY-X25519, EVP_PKEY-X448, EVP_PKEY-ED25519, EVP_PKEY-ED448,
6 EVP_KEYMGMT-X25519, EVP_KEYMGMT-X448, EVP_KEYMGMT-ED25519, EVP_KEYMGMT-ED448
7 - EVP_PKEY X25519, X448, ED25519 and ED448 keytype and algorithm support
8
9 =head1 DESCRIPTION
10
11 The B<X25519>, B<X448>, B<ED25519> and B<ED448> keytypes are
12 implemented in OpenSSL's default and FIPS providers.  These implementations
13 support the associated key, containing the public key I<pub> and the
14 private key I<priv>.
15
16 In the FIPS provider they are non-approved algorithms and do not have the
17 "fips=yes" property set.
18 No additional parameters can be set during key generation.
19
20
21 =head2 Common X25519, X448, ED25519 and ED448 parameters
22
23 In addition to the common parameters that all keytypes should support (see
24 L<provider-keymgmt(7)/Common parameters>), the implementation of these keytypes
25 support the following.
26
27 =over 4
28
29 =item "group" (B<OSSL_PKEY_PARAM_GROUP_NAME>) <UTF8 string>
30
31 This is only supported by X25519 and X448. The group name must be "x25519" or
32 "x448" repsectively for those algorithms. This is only present for consistency
33 with other key exchange algorithms and is typically not needed.
34
35 =item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
36
37 The public key value.
38
39 =item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
40
41 The private key value.
42
43 =item "tls-encoded-pt" (B<OSSL_PKEY_PARAM_TLS_ENCODED_PT>) <octet string>
44
45 Used for getting and setting the encoding of the public key used in a key exchange
46 message for the TLS protocol.
47
48 =back
49
50 =head2 ED25519 and ED448 parameters
51
52 =over 4
53
54 =item "mandatory-digest" (B<OSSL_PKEY_PARAM_MANDATORY_DIGEST>) <utf8 string>
55
56 The empty string, signifying that no digest may be specified.
57
58 =back
59
60 =head1 CONFORMING TO
61
62 =over 4
63
64 =item RFC 8032
65
66 =item RFC 8410
67
68 =back
69
70 =head1 EXAMPLES
71
72 An B<EVP_PKEY> context can be obtained by calling:
73
74     EVP_PKEY_CTX *pctx =
75         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
76
77     EVP_PKEY_CTX *pctx =
78         EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
79
80     EVP_PKEY_CTX *pctx =
81         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
82
83     EVP_PKEY_CTX *pctx =
84         EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
85
86 An B<ED25519> key can be generated like this:
87
88     EVP_PKEY *pkey = NULL;
89     EVP_PKEY_CTX *pctx =
90         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
91
92     EVP_PKEY_keygen_init(pctx);
93     EVP_PKEY_gen(pctx, &pkey);
94     EVP_PKEY_CTX_free(pctx);
95
96 An B<X25519> key can be generated in a similar way:
97
98     EVP_PKEY *pkey = NULL;
99     EVP_PKEY_CTX *pctx =
100         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
101
102     EVP_PKEY_keygen_init(pctx);
103     EVP_PKEY_gen(pctx, &pkey);
104     EVP_PKEY_CTX_free(pctx);
105
106 =head1 SEE ALSO
107
108 L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
109 L<EVP_KEYEXCH-X25519(7)>, L<EVP_KEYEXCH-X448(7)>,
110 L<EVP_SIGNATURE-ED25519(7)>, L<EVP_SIGNATURE-ED448(7)>
111
112 =head1 COPYRIGHT
113
114 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
115
116 Licensed under the Apache License 2.0 (the "License").  You may not use
117 this file except in compliance with the License.  You can obtain a copy
118 in the file LICENSE in the source distribution or at
119 L<https://www.openssl.org/source/license.html>.
120
121 =cut