EVP_PKEY-X25519.pod 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY-X25519, EVP_PKEY-X448, EVP_PKEY-ED25519, EVP_PKEY-ED448,
  4. EVP_KEYMGMT-X25519, EVP_KEYMGMT-X448, EVP_KEYMGMT-ED25519, EVP_KEYMGMT-ED448
  5. - EVP_PKEY X25519, X448, ED25519 and ED448 keytype and algorithm support
  6. =head1 DESCRIPTION
  7. The B<X25519>, B<X448>, B<ED25519> and B<ED448> keytypes are
  8. implemented in OpenSSL's default and FIPS providers. These implementations
  9. support the associated key, containing the public key I<pub> and the
  10. private key I<priv>.
  11. No additional parameters can be set during key generation.
  12. =head2 Common X25519, X448, ED25519 and ED448 parameters
  13. In addition to the common parameters that all keytypes should support (see
  14. L<provider-keymgmt(7)/Common parameters>), the implementation of these keytypes
  15. support the following.
  16. =over 4
  17. =item "group" (B<OSSL_PKEY_PARAM_GROUP_NAME>) <UTF8 string>
  18. This is only supported by X25519 and X448. The group name must be "x25519" or
  19. "x448" respectively for those algorithms. This is only present for consistency
  20. with other key exchange algorithms and is typically not needed.
  21. =item "pub" (B<OSSL_PKEY_PARAM_PUB_KEY>) <octet string>
  22. The public key value.
  23. =item "priv" (B<OSSL_PKEY_PARAM_PRIV_KEY>) <octet string>
  24. The private key value.
  25. =item "encoded-pub-key" (B<OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY>) <octet string>
  26. Used for getting and setting the encoding of a public key for the B<X25519> and
  27. B<X448> key types. Public keys are expected be encoded in a format as defined by
  28. RFC7748.
  29. =back
  30. =head2 ED25519 and ED448 parameters
  31. =over 4
  32. =item "mandatory-digest" (B<OSSL_PKEY_PARAM_MANDATORY_DIGEST>) <UTF8 string>
  33. The empty string, signifying that no digest may be specified.
  34. =back
  35. =head1 CONFORMING TO
  36. =over 4
  37. =item RFC 8032
  38. =item RFC 8410
  39. =back
  40. =head1 EXAMPLES
  41. An B<EVP_PKEY> context can be obtained by calling:
  42. EVP_PKEY_CTX *pctx =
  43. EVP_PKEY_CTX_new_from_name(NULL, "X25519", NULL);
  44. EVP_PKEY_CTX *pctx =
  45. EVP_PKEY_CTX_new_from_name(NULL, "X448", NULL);
  46. EVP_PKEY_CTX *pctx =
  47. EVP_PKEY_CTX_new_from_name(NULL, "ED25519", NULL);
  48. EVP_PKEY_CTX *pctx =
  49. EVP_PKEY_CTX_new_from_name(NULL, "ED448", NULL);
  50. An B<X25519> key can be generated like this:
  51. pkey = EVP_PKEY_Q_keygen(NULL, NULL, "X25519");
  52. An B<X448>, B<ED25519>, or B<ED448> key can be generated likewise.
  53. =head1 SEE ALSO
  54. L<EVP_KEYMGMT(3)>, L<EVP_PKEY(3)>, L<provider-keymgmt(7)>,
  55. L<EVP_KEYEXCH-X25519(7)>, L<EVP_KEYEXCH-X448(7)>,
  56. L<EVP_SIGNATURE-ED25519(7)>, L<EVP_SIGNATURE-ED448(7)>
  57. =head1 COPYRIGHT
  58. Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
  59. Licensed under the Apache License 2.0 (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>.
  63. =cut