EVP_PKEY_PRINT_PRIVATE(3SSL)
π EVP_PKEY_PRINT_PRIVATE π
okay bestie, welcome to the OpenSSL manual page for all the key-printing routines, living in the 3SSL section of the OpenSSL docs. this is the one that shows you what's inside your key. let's get into it π«Ά
β¨ NAME β¨
EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params, EVP_PKEY_print_public_fp, EVP_PKEY_print_private_fp, EVP_PKEY_print_params_fp β the public key algorithm printing routines π
πΈ SYNOPSIS πΈ
#include <openssl/evp.h>
int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
int EVP_PKEY_print_public_fp(FILE *fp, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
int EVP_PKEY_print_private_fp(FILE *fp, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
int EVP_PKEY_print_params_fp(FILE *fp, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx);
like. six functions. three vibes (public / private / params). two destinations (BIO or FILE). the math is mathing β¨
π¦ DESCRIPTION π¦
so, EVP_PKEY_print_public(), EVP_PKEY_print_private() and EVP_PKEY_print_params() print out the public, private or parameter components of key pkey, respectively. the key gets sent to the BIO out in human readable form. main character energy, but make it legible π
the parameter indent tells the printout how far it should be indented. yes queen, we're formatting.
the pctx parameter lets the print output be finely tuned with ASN1 printing options. if pctx is set to NULL, then default values will be used. no pctx? no problem π
and the _fp girlies β EVP_PKEY_print_public_fp(), EVP_PKEY_print_private_fp() and EVP_PKEY_print_params_fp() β do the exact same thing as the BIO based functions, except they use FILE fp instead. same energy, different sink π
π₯ NOTES π₯
okay so currently, no public key algorithms include any options in the pctx parameter. it's giving "the lever exists but nothing's hooked up to it yet." icons of potential πβ¨
also important, bestie: if the key doesn't include all the components indicated by the function, then only the ones that are contained in the key will be printed. for example, passing a public key to EVP_PKEY_print_private() will only print the public components. no cap β it can only show you what it's got π
π RETURN VALUES π
these functions all return 1 for success, and 0 or a negative value for failure.
and in particular? a return value of -2 indicates the operation is not supported by the public key algorithm. that one's the "ma'am this is a Wendy's" signal, iykyk π
β SEE ALSO β
π HISTORY π
EVP_PKEY_print_public(),EVP_PKEY_print_private(), andEVP_PKEY_print_params()were added in OpenSSL 1.0.0. vintage, honestly.EVP_PKEY_print_public_fp(),EVP_PKEY_print_private_fp(), andEVP_PKEY_print_params_fp()were added in OpenSSL 3.0. the glow-up era π«Ά
π COPYRIGHT π
Copyright 2006-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay that's the whole page, bestie, you ate it π this was EVP_PKEY_PRINT_PRIVATE(3SSL) from OpenSSL 4.0.3, dated 2026-09-29 β go forth and print those keys, periodt π
β¨π
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms