Current Path : /compat/linux/proc/self/root/usr/opt/openssl11/share/doc/openssl/html/man7/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/proc/self/root/usr/opt/openssl11/share/doc/openssl/html/man7/X25519.html |
<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>X25519</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@hsxx.drive.ne.jp" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <ul> <li><a href="#name">NAME</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#notes">NOTES</a></li> <li><a href="#examples">EXAMPLES</a></li> <li><a href="#see_also">SEE ALSO</a></li> <li><a href="#copyright">COPYRIGHT</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <hr /> <h1><a name="name">NAME</a></h1> <p>X25519, X448 - EVP_PKEY X25519 and X448 support</p> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>The <strong>X25519</strong> and <strong>X448</strong> EVP_PKEY implementation supports key generation and key derivation using <strong>X25519</strong> and <strong>X448</strong>. It has associated private and public key formats compatible with <a href="http://www.ietf.org/rfc/rfc8410.txt" class="rfc">RFC 8410</a>.</p> <p>No additional parameters can be set during key generation.</p> <p>The peer public key must be set using <code>EVP_PKEY_derive_set_peer()</code> when performing key derivation.</p> <p> </p> <hr /> <h1><a name="notes">NOTES</a></h1> <p>A context for the <strong>X25519</strong> algorithm can be obtained by calling:</p> <pre> EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL);</pre> <p>For the <strong>X448</strong> algorithm a context can be obtained by calling:</p> <pre> EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL);</pre> <p>X25519 or X448 private keys can be set directly using <em>EVP_PKEY_new_raw_private_key(3)</em> or loaded from a PKCS#8 private key file using <em>PEM_read_bio_PrivateKey(3)</em> (or similar function). Completely new keys can also be generated (see the example below). Setting a private key also sets the associated public key.</p> <p>X25519 or X448 public keys can be set directly using <em>EVP_PKEY_new_raw_public_key(3)</em> or loaded from a SubjectPublicKeyInfo structure in a PEM file using <em>PEM_read_bio_PUBKEY(3)</em> (or similar function).</p> <p> </p> <hr /> <h1><a name="examples">EXAMPLES</a></h1> <p>This example generates an <strong>X25519</strong> private key and writes it to standard output in PEM format:</p> <pre> #include <openssl/evp.h> #include <openssl/pem.h> ... EVP_PKEY *pkey = NULL; EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X25519, NULL); EVP_PKEY_keygen_init(pctx); EVP_PKEY_keygen(pctx, &pkey); EVP_PKEY_CTX_free(pctx); PEM_write_PrivateKey(stdout, pkey, NULL, NULL, 0, NULL, NULL);</pre> <p>The key derivation example in <em>EVP_PKEY_derive(3)</em> can be used with <strong>X25519</strong> and <strong>X448</strong>.</p> <p> </p> <hr /> <h1><a name="see_also">SEE ALSO</a></h1> <p><em>EVP_PKEY_CTX_new(3)</em>, <em>EVP_PKEY_keygen(3)</em>, <em>EVP_PKEY_derive(3)</em>, <em>EVP_PKEY_derive_set_peer(3)</em></p> <p> </p> <hr /> <h1><a name="copyright">COPYRIGHT</a></h1> <p>Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved.</p> <p>Licensed under the OpenSSL license (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 <a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p> </body> </html>