EVP_PKEY_PRINT_PRIVATE(3)
π EVP_PKEY_PRINT_PRIVATE(3) β like, the crypto printing girlies
okay so bestie, this is a page from the Library Functions Manual, and it's about the public key algorithm printing routines. yes, that's a whole thing, and yes, we're gonna get into it π
β¨ NAME β¨
EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params β the public key algorithm printing routines. it's giving "make my key readable," fr fr π«Ά
πΈ SYNOPSIS πΈ
first things first, you gotta pull in the library: libcrypto
#include <openssl/evp.h>
then, the three icons themselves:
int
EVP_PKEY_print_public(BIO *out, 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_params(BIO *out, const EVP_PKEY *pkey, int indent,
ASN1_PCTX *pctx);
like, same shape, three different jobs. main character energy for each π
π¦ DESCRIPTION π¦
so here's the tea β β EVP_PKEY_print_public(), EVP_PKEY_print_private(), and EVP_PKEY_print_params() print out the public, private, or parameter components of the key pkey, respectively. each one handles its own little slice, and they're all obsessed with their specific job.
the key gets sent to the BIO out in human readable form β like, actual words and numbers your eyeballs can parse, not a wall of hex. iconic β¨
the parameter indent tells it how far the printout should be indented. yes, it's just spacing. yes, it matters. aesthetics are content π
the pctx parameter lets you finely tune the print output by using ASN.1 printing options. if pctx is set to NULL, then default values will be used. and ngl, currently, no public key algorithms include any options in the pctx parameter β so it's kind of just sitting there looking pretty rn π
and here's the part where it gets smart: if the key does not include all the components indicated by the function, then only those contained in the key will be printed. like, for example, passing a public key to EVP_PKEY_print_private() will only print the public components. it prints what it has, no invented lore, no cap π§
β RETURN VALUES β
okay so the vibe check on returns:
- these functions all return
1for success π - and
0or a negative value for failure π
and specifically β a return value of -2 indicates the operation is not supported by the public key algorithm. so if you see -2, that's your sign, it's not a you problem, the algorithm just doesn't do that π
π SEE ALSO π
go read these next, iykyk:
π HISTORY π
these functions first appeared in OpenSSL 1.0.0 and have been available since OpenBSD 4.9. so they've been around. veteran icons only π₯
and that's the whole page, bestie π β written by the Debian girlies, dated June 8, 2025, and filed under EVP_PKEY_PRINT_PRIVATE(3). slay, go print some keys π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2006, 2009 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms