EVP_PKEY_print_private.pod 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. =pod
  2. =head1 NAME
  3. EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params,
  4. EVP_PKEY_print_public_fp, EVP_PKEY_print_private_fp,
  5. EVP_PKEY_print_params_fp - public key algorithm printing routines
  6. =head1 SYNOPSIS
  7. #include <openssl/evp.h>
  8. int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
  9. int indent, ASN1_PCTX *pctx);
  10. int EVP_PKEY_print_public_fp(FILE *fp, const EVP_PKEY *pkey,
  11. int indent, ASN1_PCTX *pctx);
  12. int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
  13. int indent, ASN1_PCTX *pctx);
  14. int EVP_PKEY_print_private_fp(FILE *fp, const EVP_PKEY *pkey,
  15. int indent, ASN1_PCTX *pctx);
  16. int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
  17. int indent, ASN1_PCTX *pctx);
  18. int EVP_PKEY_print_params_fp(FILE *fp, const EVP_PKEY *pkey,
  19. int indent, ASN1_PCTX *pctx);
  20. =head1 DESCRIPTION
  21. The functions EVP_PKEY_print_public(), EVP_PKEY_print_private() and
  22. EVP_PKEY_print_params() print out the public, private or parameter components
  23. of key I<pkey> respectively. The key is sent to B<BIO> I<out> in human readable
  24. form. The parameter I<indent> indicates how far the printout should be indented.
  25. The I<pctx> parameter allows the print output to be finely tuned by using
  26. ASN1 printing options. If I<pctx> is set to NULL then default values will
  27. be used.
  28. The functions EVP_PKEY_print_public_fp(), EVP_PKEY_print_private_fp() and
  29. EVP_PKEY_print_params_fp() do the same as the B<BIO> based functions
  30. but use B<FILE> I<fp> instead.
  31. =head1 NOTES
  32. Currently no public key algorithms include any options in the I<pctx> parameter.
  33. If the key does not include all the components indicated by the function then
  34. only those contained in the key will be printed. For example passing a public
  35. key to EVP_PKEY_print_private() will only print the public components.
  36. =head1 RETURN VALUES
  37. These functions all return 1 for success and 0 or a negative value for failure.
  38. In particular a return value of -2 indicates the operation is not supported by
  39. the public key algorithm.
  40. =head1 SEE ALSO
  41. L<EVP_PKEY_CTX_new(3)>,
  42. L<EVP_PKEY_keygen(3)>
  43. =head1 HISTORY
  44. The functions EVP_PKEY_print_public(), EVP_PKEY_print_private(),
  45. and EVP_PKEY_print_params() were added in OpenSSL 1.0.0.
  46. The functions EVP_PKEY_print_public_fp(), EVP_PKEY_print_private_fp(),
  47. and EVP_PKEY_print_params_fp() were added in OpenSSL 3.0.
  48. =head1 COPYRIGHT
  49. Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
  50. Licensed under the Apache License 2.0 (the "License"). You may not use
  51. this file except in compliance with the License. You can obtain a copy
  52. in the file LICENSE in the source distribution or at
  53. L<https://www.openssl.org/source/license.html>.
  54. =cut