7 - EVP_PKEY X25519 and X448 support
11 The B<X25519> and B<X448> EVP_PKEY implementation supports key generation and
12 key derivation using B<X25519> and B<X448>. It has associated private and public
13 key formats compatible with draft-ietf-curdle-pkix-03.
15 No additional parameters can be set during key generation.
17 The peer public key must be set using EVP_PKEY_derive_set_peer() when
18 performing key derivation.
22 A context for the B<X25519> algorithm can be obtained by calling:
24 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
26 For the B<X448> algorithm a context can be obtained by calling:
28 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL);
32 This example generates an B<X25519> private key and writes it to standard
35 #include <openssl/evp.h>
36 #include <openssl/pem.h>
38 EVP_PKEY *pkey = NULL;
39 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);
40 EVP_PKEY_keygen_init(pctx);
41 EVP_PKEY_keygen(pctx, &pkey);
42 EVP_PKEY_CTX_free(pctx);
43 PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);
45 The key derivation example in L<EVP_PKEY_derive(3)> can be used with
46 B<X25519> and B<X448>.
50 L<EVP_PKEY_CTX_new(3)>,
51 L<EVP_PKEY_keygen(3)>,
52 L<EVP_PKEY_derive(3)>,
53 L<EVP_PKEY_derive_set_peer(3)>
57 Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
59 Licensed under the OpenSSL license (the "License"). You may not use
60 this file except in compliance with the License. You can obtain a copy
61 in the file LICENSE in the source distribution or at
62 L<https://www.openssl.org/source/license.html>.