EVP_PKEY_PRINT_PRIVATE(3ossl)
πΈ NAME πΈ
okay bestie, welcome to the EVP_PKEY_PRINT_PRIVATE(3ossl) page β it's the OpenSSL manual for the public key algorithm printing routines. The whole squad is: EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params, EVP_PKEY_print_public_fp, EVP_PKEY_print_private_fp, and EVP_PKEY_print_params_fp. Yes, that's a lot of names, but they're all doing cute little printouts. π
β¨ 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);
π¦ DESCRIPTION π¦
okay so here's the tea β β these three iconic functions print out different parts of a key:
EVP_PKEY_print_public()β prints the public components of keypkey.EVP_PKEY_print_private()β prints the private components of keypkey.EVP_PKEY_print_params()β prints the parameter components of keypkey.
The key gets sent to BIO out in human readable form. And the indent parameter? It says how far the printout should be indented. Basically it's the aesthetic spacing, bestie. β¨
The pctx parameter lets you finely tune the print output by using ASN1 printing options. If pctx is set to NULL, then default values will be used. No cap.
And the _fp girlies:
EVP_PKEY_print_public_fp()EVP_PKEY_print_private_fp()EVP_PKEY_print_params_fp()
do the same as the BIO based functions, but they use FILE fp instead. Same energy, different output situation. π«Ά
π NOTES π
Currently no public key algorithms include any options in the pctx parameter. That's just where we're at, bestie. π
If the key does not include all the components indicated by the function, then only those contained in the key will be printed. Example time: passing a public key to EVP_PKEY_print_private() will only print the public components. It's giving "work with what you've got." π
π₯ RETURN VALUES π₯
These functions all return 1 for success and 0 or a negative value for failure. In particular, a return value of -2 indicates the operation is not supported by the public key algorithm. So if you see -2, that algorithm said "not today." π
π SEE ALSO π
go read those too, iykyk. π
π HISTORY π
The functions EVP_PKEY_print_public(), EVP_PKEY_print_private(), and EVP_PKEY_print_params() were added in OpenSSL 1.0.0.
The functions EVP_PKEY_print_public_fp(), EVP_PKEY_print_private_fp(), and EVP_PKEY_print_params_fp() were added in OpenSSL 3.0.
periodt. β
π 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>.
and that's the whole manual page, bestie π§ β this iconic thing comes from OpenSSL 3.5.6, dated 2026-04-07, and the page is EVP_PKEY_PRINT_PRIVATE(3ossl). slay. π
π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms