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