RSA_NEW(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

✨ 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 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