xref: /freebsd/crypto/openssl/doc/man3/RSA_new.pod (revision ba3c1f5972d7b90feb6e6da47905ff2757e0fe57)
1=pod
2
3=head1 NAME
4
5RSA_new, RSA_free - allocate and free RSA objects
6
7=head1 SYNOPSIS
8
9 #include <openssl/rsa.h>
10
11The following functions have been deprecated since OpenSSL 3.0, and can be
12hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value,
13see L<openssl_user_macros(7)>:
14
15 RSA *RSA_new(void);
16
17 void RSA_free(RSA *rsa);
18
19=head1 DESCRIPTION
20
21RSA_new() allocates and initializes an B<RSA> structure. It is equivalent to
22calling RSA_new_method(NULL).
23
24RSA_free() frees the B<RSA> structure and its components. The key is
25erased before the memory is returned to the system.
26If B<rsa> is NULL nothing is done.
27
28=head1 RETURN VALUES
29
30If the allocation fails, RSA_new() returns B<NULL> and sets an error
31code that can be obtained by L<ERR_get_error(3)>. Otherwise it returns
32a pointer to the newly allocated structure.
33
34RSA_free() returns no value.
35
36=head1 SEE ALSO
37
38L<ERR_get_error(3)>,
39L<RSA_generate_key(3)>,
40L<RSA_new_method(3)>
41
42=head1 HISTORY
43
44All functions described here were deprecated in OpenSSL 3.0.
45For replacement see EVP_PKEY-RSA(7).
46
47=head1 COPYRIGHT
48
49Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
50
51Licensed under the Apache License 2.0 (the "License").  You may not use
52this file except in compliance with the License.  You can obtain a copy
53in the file LICENSE in the source distribution or at
54L<https://www.openssl.org/source/license.html>.
55
56=cut
57