DOC: Refactor provider-keymgmt(7) to give the keytypes their own pages
[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 =head1 CONFORMING TO
32
33 =over 4
34
35 =item RFC 8032
36
37 =back
38
39 =head1 EXAMPLES
40
41 An B<EVP_PKEY> context can be obtained by calling:
42
43     EVP_PKEY_CTX *pctx =
44         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
45
46     EVP_PKEY_CTX *pctx =
47         EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
48
49     EVP_PKEY_CTX *pctx =
50         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
51
52     EVP_PKEY_CTX *pctx =
53         EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
54
55 An B<ED25519> key can be generated like this:
56
57     EVP_PKEY *pkey = NULL;
58     EVP_PKEY_CTX *pctx =
59         EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
60
61     EVP_PKEY_keygen_init(pctx);
62     EVP_PKEY_gen(pctx, &pkey);
63     EVP_PKEY_CTX_free(pctx);
64
65 An B<X25519> key can be generated in a similar way:
66
67     EVP_PKEY *pkey = NULL;
68     EVP_PKEY_CTX *pctx =
69         EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
70
71     EVP_PKEY_keygen_init(pctx);
72     EVP_PKEY_gen(pctx, &pkey);
73     EVP_PKEY_CTX_free(pctx);
74
75 =head1 SEE ALSO
76
77 L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
78 L<EVP_KEYEXCH-X25519(7)>, L<EVP_KEYEXCH-X448(7)>,
79 L<EVP_SIGNATURE-ED25519(7)>, L<EVP_SIGNATURE-ED448(7)>
80
81 =head1 COPYRIGHT
82
83 Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
84
85 Licensed under the Apache License 2.0 (the "License").  You may not use
86 this file except in compliance with the License.  You can obtain a copy
87 in the file LICENSE in the source distribution or at
88 L<https://www.openssl.org/source/license.html>.
89
90 =cut