1*957fef74Sschwarze.\" $OpenBSD: EVP_PKEY_print_private.3,v 1.8 2024/12/06 12:51:13 schwarze Exp $ 2cd3b7c98Sschwarze.\" OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 38974101aSjmc.\" 4cd3b7c98Sschwarze.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 5cd3b7c98Sschwarze.\" Copyright (c) 2006, 2009 The OpenSSL Project. All rights reserved. 6cd3b7c98Sschwarze.\" 7cd3b7c98Sschwarze.\" Redistribution and use in source and binary forms, with or without 8cd3b7c98Sschwarze.\" modification, are permitted provided that the following conditions 9cd3b7c98Sschwarze.\" are met: 10cd3b7c98Sschwarze.\" 11cd3b7c98Sschwarze.\" 1. Redistributions of source code must retain the above copyright 12cd3b7c98Sschwarze.\" notice, this list of conditions and the following disclaimer. 13cd3b7c98Sschwarze.\" 14cd3b7c98Sschwarze.\" 2. Redistributions in binary form must reproduce the above copyright 15cd3b7c98Sschwarze.\" notice, this list of conditions and the following disclaimer in 16cd3b7c98Sschwarze.\" the documentation and/or other materials provided with the 17cd3b7c98Sschwarze.\" distribution. 18cd3b7c98Sschwarze.\" 19cd3b7c98Sschwarze.\" 3. All advertising materials mentioning features or use of this 20cd3b7c98Sschwarze.\" software must display the following acknowledgment: 21cd3b7c98Sschwarze.\" "This product includes software developed by the OpenSSL Project 22cd3b7c98Sschwarze.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 23cd3b7c98Sschwarze.\" 24cd3b7c98Sschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 25cd3b7c98Sschwarze.\" endorse or promote products derived from this software without 26cd3b7c98Sschwarze.\" prior written permission. For written permission, please contact 27cd3b7c98Sschwarze.\" openssl-core@openssl.org. 28cd3b7c98Sschwarze.\" 29cd3b7c98Sschwarze.\" 5. Products derived from this software may not be called "OpenSSL" 30cd3b7c98Sschwarze.\" nor may "OpenSSL" appear in their names without prior written 31cd3b7c98Sschwarze.\" permission of the OpenSSL Project. 32cd3b7c98Sschwarze.\" 33cd3b7c98Sschwarze.\" 6. Redistributions of any form whatsoever must retain the following 34cd3b7c98Sschwarze.\" acknowledgment: 35cd3b7c98Sschwarze.\" "This product includes software developed by the OpenSSL Project 36cd3b7c98Sschwarze.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" 37cd3b7c98Sschwarze.\" 38cd3b7c98Sschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 39cd3b7c98Sschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 40cd3b7c98Sschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 41cd3b7c98Sschwarze.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 42cd3b7c98Sschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 43cd3b7c98Sschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 44cd3b7c98Sschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 45cd3b7c98Sschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 46cd3b7c98Sschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 47cd3b7c98Sschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 48cd3b7c98Sschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49cd3b7c98Sschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50cd3b7c98Sschwarze.\" 51*957fef74Sschwarze.Dd $Mdocdate: December 6 2024 $ 52d5c51cd3Sschwarze.Dt EVP_PKEY_PRINT_PRIVATE 3 53d5c51cd3Sschwarze.Os 54d5c51cd3Sschwarze.Sh NAME 55d5c51cd3Sschwarze.Nm EVP_PKEY_print_public , 56d5c51cd3Sschwarze.Nm EVP_PKEY_print_private , 57d5c51cd3Sschwarze.Nm EVP_PKEY_print_params 58d5c51cd3Sschwarze.Nd public key algorithm printing routines 59d5c51cd3Sschwarze.Sh SYNOPSIS 60d5c51cd3Sschwarze.In openssl/evp.h 61d5c51cd3Sschwarze.Ft int 62d5c51cd3Sschwarze.Fo EVP_PKEY_print_public 63d5c51cd3Sschwarze.Fa "BIO *out" 64d5c51cd3Sschwarze.Fa "const EVP_PKEY *pkey" 65d5c51cd3Sschwarze.Fa "int indent" 66d5c51cd3Sschwarze.Fa "ASN1_PCTX *pctx" 67d5c51cd3Sschwarze.Fc 68d5c51cd3Sschwarze.Ft int 69d5c51cd3Sschwarze.Fo EVP_PKEY_print_private 70d5c51cd3Sschwarze.Fa "BIO *out" 71d5c51cd3Sschwarze.Fa "const EVP_PKEY *pkey" 72d5c51cd3Sschwarze.Fa "int indent" 73d5c51cd3Sschwarze.Fa "ASN1_PCTX *pctx" 74d5c51cd3Sschwarze.Fc 75d5c51cd3Sschwarze.Ft int 76d5c51cd3Sschwarze.Fo EVP_PKEY_print_params 77d5c51cd3Sschwarze.Fa "BIO *out" 78d5c51cd3Sschwarze.Fa "const EVP_PKEY *pkey" 79d5c51cd3Sschwarze.Fa "int indent" 80d5c51cd3Sschwarze.Fa "ASN1_PCTX *pctx" 81d5c51cd3Sschwarze.Fc 82d5c51cd3Sschwarze.Sh DESCRIPTION 83d5c51cd3SschwarzeThe functions 84d5c51cd3Sschwarze.Fn EVP_PKEY_print_public , 85d5c51cd3Sschwarze.Fn EVP_PKEY_print_private , 86d5c51cd3Sschwarzeand 87d5c51cd3Sschwarze.Fn EVP_PKEY_print_params 88d5c51cd3Sschwarzeprint out the public, private or parameter components of key 89d5c51cd3Sschwarze.Fa pkey , 90d5c51cd3Sschwarzerespectively. 91d5c51cd3SschwarzeThe key is sent to 92d5c51cd3Sschwarze.Vt BIO 93d5c51cd3Sschwarze.Fa out 94d5c51cd3Sschwarzein human readable form. 95d5c51cd3SschwarzeThe parameter 96d5c51cd3Sschwarze.Fa indent 97d5c51cd3Sschwarzeindicates how far the printout should be indented. 98d5c51cd3Sschwarze.Pp 99d5c51cd3SschwarzeThe 100d5c51cd3Sschwarze.Fa pctx 10184a81591Sjmcparameter allows the print output to be finely tuned by using ASN.1 102d5c51cd3Sschwarzeprinting options. 103d5c51cd3SschwarzeIf 104d5c51cd3Sschwarze.Fa pctx 105d5c51cd3Sschwarzeis set to 106d5c51cd3Sschwarze.Dv NULL , 107d5c51cd3Sschwarzethen default values will be used. 108d5c51cd3SschwarzeCurrently, no public key algorithms include any options in the 109d5c51cd3Sschwarze.Fa pctx 110d5c51cd3Sschwarzeparameter. 111d5c51cd3Sschwarze.Pp 112d5c51cd3SschwarzeIf the key does not include all the components indicated by the function, 113d5c51cd3Sschwarzethen only those contained in the key will be printed. 114d5c51cd3SschwarzeFor example, passing a public key to 115d5c51cd3Sschwarze.Fn EVP_PKEY_print_private 116d5c51cd3Sschwarzewill only print the public components. 117d5c51cd3Sschwarze.Sh RETURN VALUES 118d5c51cd3SschwarzeThese functions all return 1 for success and 0 or a negative value for 119d5c51cd3Sschwarzefailure. 120d5c51cd3SschwarzeIn particular, a return value of -2 indicates the operation is not 121d5c51cd3Sschwarzesupported by the public key algorithm. 122d5c51cd3Sschwarze.Sh SEE ALSO 123d5c51cd3Sschwarze.Xr EVP_PKEY_CTX_new 3 , 124c4c55c71Sschwarze.Xr EVP_PKEY_keygen 3 , 125c4c55c71Sschwarze.Xr EVP_PKEY_new 3 126d5c51cd3Sschwarze.Sh HISTORY 12756929f71SschwarzeThese functions first appeared in OpenSSL 1.0.0 12856929f71Sschwarzeand have been available since 12956929f71Sschwarze.Ox 4.9 . 130