PROV: Ensure that ED25519 & ED448 keys have a mandatory digest
[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 provider.
13
14 =head2 Common X25519, X448, ED25519 and ED448 parameters
15
16 The following Import/Export types are available for the built-in X25519, X448,
17 ED25519 and X448 algorithms:
18
19 =over 4
20
21 =item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
22
23 The public key value.
24
25 =item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
26
27 The private key value.
28
29 =back
30
31 =head2 ED25519 and ED448 parameters
32
33 =over 4
34
35 =item "mandatory-digest" (B<OSSL_PKEY_PARAM_MANDATORY_DIGEST>) <utf8 string>
36
37 The empty string, signifying that no digest may be specified.
38
39 =back
40
41 =head1 CONFORMING TO
42
43 =over 4
44
45 =item RFC 8032
46
47 =back
48
49 =head1 EXAMPLES
50
51 An B<EVP_PKEY> context can be obtained by calling:
52
53     EVP_PKEY_CTX *pctx =
54         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
55
56     EVP_PKEY_CTX *pctx =
57         EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
58
59     EVP_PKEY_CTX *pctx =
60         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
61
62     EVP_PKEY_CTX *pctx =
63         EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
64
65 An B<ED25519> key can be generated like this:
66
67     EVP_PKEY *pkey = NULL;
68     EVP_PKEY_CTX *pctx =
69         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
70
71     EVP_PKEY_keygen_init(pctx);
72     EVP_PKEY_gen(pctx, &pkey);
73     EVP_PKEY_CTX_free(pctx);
74
75 An B<X25519> key can be generated in a similar way:
76
77     EVP_PKEY *pkey = NULL;
78     EVP_PKEY_CTX *pctx =
79         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
80
81     EVP_PKEY_keygen_init(pctx);
82     EVP_PKEY_gen(pctx, &pkey);
83     EVP_PKEY_CTX_free(pctx);
84
85 =head1 SEE ALSO
86
87 L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
88 L<EVP_KEYEXCH-X25519(7)>, L<EVP_KEYEXCH-X448(7)>,
89 L<EVP_SIGNATURE-ED25519(7)>, L<EVP_SIGNATURE-ED448(7)>
90
91 =head1 COPYRIGHT
92
93 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
94
95 Licensed under the Apache License 2.0 (the "License").  You may not use
96 this file except in compliance with the License.  You can obtain a copy
97 in the file LICENSE in the source distribution or at
98 L<https://www.openssl.org/source/license.html>.
99
100 =cut