RSA_PRINT(3SSL)

✨ NAME ✨

okay so this is the 3SSL page for the OpenSSL family of print-y functions, and it covers: RSA_print, RSA_print_fp, DSAparams_print, DSAparams_print_fp, DSA_print, DSA_print_fp, DHparams_print, DHparams_print_fp β€” and what they all do, collectively, is print cryptographic parameters. that's it. that's the function. it prints your crypto stuff in a way humans can read πŸ’–


🌸 SYNOPSIS 🌸

first up, the RSA girlies:

#include <openssl/rsa.h>
heads up bestie: the functions below have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” see openssl_user_macros(7) for the deets.
int RSA_print(BIO *bp, const RSA *x, int offset);
int RSA_print_fp(FILE *fp, const RSA *x, int offset);

then the DSA corner:

#include <openssl/dsa.h>
same warning, same energy: these have been deprecated since OpenSSL 3.0 too, and yes they can also be hidden entirely by defining OPENSSL_API_COMPAT with a suitable version value, see openssl_user_macros(7).
int DSAparams_print(BIO *bp, const DSA *x);
int DSAparams_print_fp(FILE *fp, const DSA *x);
int DSA_print(BIO *bp, const DSA *x, int offset);
int DSA_print_fp(FILE *fp, const DSA *x, int offset);

and finally, DH, the third member of the trio πŸŽ€

#include <openssl/dh.h>
you already know what i'm gonna say: deprecated since OpenSSL 3.0, hideable by defining OPENSSL_API_COMPAT with a suitable version value, check openssl_user_macros(7).
int DHparams_print(BIO *bp, DH *x);
int DHparams_print_fp(FILE *fp, const DH *x);

πŸ’… DESCRIPTION πŸ’…

okay so real talk: all of the functions described on this page are deprecated. not like "kinda old" deprecated, like actually don't use these for new stuff deprecated. if you're writing an application, the glow-up move is to use EVP_PKEY_print_params(3) and EVP_PKEY_print_private(3) instead. periodt. πŸ‘‘

what they actually do β€” and they do this fine, they're just old β€” is print a human-readable hexadecimal output of the components of the RSA key, or the DSA parameters or key, or the DH parameters. and where does it go? to bp or to fp. your choice, bestie. ✨

also! the output lines get indented by offset spaces. so cute. so customizable. πŸŽ€


🫢 RETURN VALUES 🫢

  • DSAparams_print(), DSAparams_print_fp(), DSA_print(), and DSA_print_fp() β€” return 1 for success, and 0 or a negative value for failure 😭
  • DHparams_print() and DHparams_print_fp() β€” return 1 on success, 0 on error. that's it. no weird negative values here, she's simple. πŸ’œ

πŸ‘€ SEE ALSO πŸ‘€


πŸ“œ HISTORY πŸ“œ

literally all of these functions were deprecated in OpenSSL 3.0. every single one. rip to them but they're different now. πŸ™ˆ


Copyright 2000-2020 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>.


k that's the whole page bestie, ily, go forth and print your parameters responsibly πŸ’–βœ¨πŸŽ€

this was RSA_PRINT(3SSL) from OpenSSL, version 4.0.3, dated 2026-09-29 β€” mwah, no cap, slay 🫢

πŸ“¦ where this page comes from