RSA_NEW(3ossl)
β¨ RSA_NEW β¨
okay bestie, welcome to the RSA_new(3ossl) page β it's an OpenSSL joint, and it's all about allocating and freeing RSA objects π
πΈ SYNOPSIS πΈ
#include <openssl/rsa.h>
so here's the thing: 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 β check openssl_user_macros(7) for the deets π
RSA *RSA_new(void);
void RSA_free(RSA *rsa);
π¦ DESCRIPTION π¦
RSA_new() allocates and initializes an RSA structure. lowkey it's literally the same thing as calling RSA_new_method(NULL) β like, equivalent, no cap π«Ά
RSA_free() frees the RSA structure and its components. and bestie, it's thorough: the key gets erased before the memory is handed back to the system π₯ so your secrets don't just vibe in freed memory, yk? and if rsa is NULL? nothing happens. nothing. zero. zilch π
β RETURN VALUES β
if the allocation fails, RSA_new() returns NULL and sets an error code β grab it with ERR_get_error(3) π otherwise it hands you back a pointer to the freshly allocated structure, slay β¨
RSA_free() returns no value. it just does its thing and dips π
π SEE ALSO π
π HISTORY π
all the functions described here were deprecated in OpenSSL 3.0. for the replacement, go look at EVP_PKEY-RSA(7) β that's your new main character now π
π COPYRIGHT π
Copyright 2000-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 page, bestie π§ this was 3.5.0, dated 2026-09-25 β mwah, go forth and allocate responsibly π
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms