5 X25519 - EVP_PKEY X25519 support
9 The B<X25519> EVP_PKEY implementation supports key generation and key
10 derivation using B<X25519>. It has associated private and public key formats
11 compatible with draft-ietf-curdle-pkix-03.
13 No additional parameters can be set during key generation.
15 The peer public key must be set using EVP_PKEY_derive_set_peer() when
16 performing key derivation.
20 A context for the B<X25519> algorithm can be obtained by calling:
22 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(NID_X25519, NULL);
26 This example generates an B<X25519> private key and writes it to standard
29 #include <openssl/evp.h>
30 #include <openssl/pem.h>
32 EVP_PKEY *pkey = NULL;
33 EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(NID_X25519, NULL);
34 EVP_PKEY_keygen_init(pctx);
35 EVP_PKEY_keygen(pctx, &pkey);
36 EVP_PKEY_CTX_free(pctx);
37 PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);
39 The key derviation example in L<EVP_PKEY_derive(3)> can be used with
44 L<EVP_PKEY_CTX_new(3)>,
45 L<EVP_PKEY_keygen(3)>,
46 L<EVP_PKEY_derive(3)>,
47 L<EVP_PKEY_derive_set_peer(3)>
51 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
53 Licensed under the OpenSSL license (the "License"). You may not use
54 this file except in compliance with the License. You can obtain a copy
55 in the file LICENSE in the source distribution or at
56 L<https://www.openssl.org/source/license.html>.