RSA_NEW(3ossl)

πŸ’– RSA_NEW(3ossl) πŸ’–

okay bestie, welcome to the RSA_new page from the OpenSSL manuals πŸŽ€ this one's a lil vintage-coded ngl, but we're gonna get through it together, hand in hand 🫢


✨ NAME ✨

RSA_new, RSA_free β€” allocate and free RSA objects πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/rsa.h>

so like, fair warning: the following functions have been deprecated since OpenSSL 3.0, and you can hide them entirely by defining OPENSSL_API_COMPAT with a suitable version value β€” check out 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. It's literally equivalent to calling RSA_new_method(NULL) β€” same thing, no cap ✨

RSA_free() frees the RSA structure and all its components. and bestie, listen β€” the key is erased before the memory gets handed back to the system πŸ§ΉπŸ’€ so your secrets aren't just vibing in freed memory, periodt. If rsa is NULL, nothing happens. literally nothing. it just moves on with its day πŸ™ˆ


πŸ‘‘ RETURN VALUES πŸ‘‘

If the allocation fails, RSA_new() returns NULL and sets an error code that you can grab with ERR_get_error(3) 😭 Otherwise it returns a pointer to the newly allocated structure β€” slay πŸ’…

RSA_free() returns no value. it's a void girlie. gives nothing, takes nothing πŸŽ€


πŸ”₯ SEE ALSO πŸ”₯


⭐ HISTORY ⭐

All functions described here were deprecated in OpenSSL 3.0 πŸ˜” For a replacement, see EVP_PKEY-RSA(7) β€” that's the 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, we ate and left no crumbs πŸ“ this was version 3.5.9, dated 2026-09-29, brought to you by the RSA_NEW(3ossl) girlies themselves 🌈 mwah, ily, go call EVP_PKEY-RSA(7) instead πŸ’–βœ¨

πŸ“¦ where this page comes from