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