EVP_KEYEXCH-X25519, EVP_KEYEXCH-X448 – X25519 and X448 Key Exchange algorithm support
| Use Case | Command / API | Description |
|---|---|---|
| Generate X25519 key pair | openssl genpkey -algorithm X25519 -out key.pem | Create a private key (includes public key) |
| Extract public key | openssl pkey -in key.pem -pubout -out pub.pem | Obtain the peer’s public key |
| Derive shared secret | openssl pkeyutl -derive -inkey key.pem -peerkey peer.pub -out secret.bin | Perform X25519/X448 ECDH |
| API key generation | EVP_PKEY_keygen(ctx, &pkey) with EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, NID_X25519) | Programmatic key pair creation |
| API key derivation | EVP_PKEY_derive_init(ctx) → EVP_PKEY_derive(ctx, secret, &secretlen) | Obtain shared secret in code |
Key exchange support for the X25519 and X448 key types.
"pad" (OSSL_EXCHANGE_PARAM_PAD) <unsigned integer>Keys for the host and peer can be generated as shown in “Examples” in EVP_PKEY-X25519(7).
The code to generate a shared secret is identical to “Examples” in EVP_KEYEXCH-DH(7).
EVP_PKEY-FFC(7), EVP_PKEY-DH(7), EVP_PKEY(3), provider-keyexch(7), provider-keymgmt(7), OSSL_PROVIDER-default(7), OSSL_PROVIDER-FIPS(7)
Copyright 2020 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the “License”). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 18:08 @2600:1f28:365:80b0:f8a4:e764:d6bb:8e66
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format