]> git.ipfire.org Git - thirdparty/openssl.git/blob - doc/man7/EVP_PKEY-X25519.pod
fa8c86844a44a4082300919cb62828b95ddc69a2
[thirdparty/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 "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
30
31 The public key value.
32
33 =item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
34
35 The private key value.
36
37 =back
38
39 =head2 ED25519 and ED448 parameters
40
41 =over 4
42
43 =item "mandatory-digest" (B<OSSL_PKEY_PARAM_MANDATORY_DIGEST>) <utf8 string>
44
45 The empty string, signifying that no digest may be specified.
46
47 =back
48
49 =head1 CONFORMING TO
50
51 =over 4
52
53 =item RFC 8032
54
55 =item RFC 8410
56
57 =back
58
59 =head1 EXAMPLES
60
61 An B<EVP_PKEY> context can be obtained by calling:
62
63 EVP_PKEY_CTX *pctx =
64 EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
65
66 EVP_PKEY_CTX *pctx =
67 EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
68
69 EVP_PKEY_CTX *pctx =
70 EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
71
72 EVP_PKEY_CTX *pctx =
73 EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
74
75 An B<ED25519> key can be generated like this:
76
77 EVP_PKEY *pkey = NULL;
78 EVP_PKEY_CTX *pctx =
79 EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
80
81 EVP_PKEY_keygen_init(pctx);
82 EVP_PKEY_gen(pctx, &pkey);
83 EVP_PKEY_CTX_free(pctx);
84
85 An B<X25519> key can be generated in a similar way:
86
87 EVP_PKEY *pkey = NULL;
88 EVP_PKEY_CTX *pctx =
89 EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
90
91 EVP_PKEY_keygen_init(pctx);
92 EVP_PKEY_gen(pctx, &pkey);
93 EVP_PKEY_CTX_free(pctx);
94
95 =head1 SEE ALSO
96
97 L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
98 L<EVP_KEYEXCH-X25519(7)>, L<EVP_KEYEXCH-X448(7)>,
99 L<EVP_SIGNATURE-ED25519(7)>, L<EVP_SIGNATURE-ED448(7)>
100
101 =head1 COPYRIGHT
102
103 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
104
105 Licensed under the Apache License 2.0 (the "License"). You may not use
106 this file except in compliance with the License. You can obtain a copy
107 in the file LICENSE in the source distribution or at
108 L<https://www.openssl.org/source/license.html>.
109
110 =cut