]>
Commit | Line | Data |
---|---|---|
2186cd8e UM |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
6a2da303 | 5 | RSA_size, RSA_bits, RSA_security_bits - get RSA modulus size or security bits |
2186cd8e UM |
6 | |
7 | =head1 SYNOPSIS | |
8 | ||
6a2da303 | 9 | #include <openssl/rsa.h> |
2186cd8e | 10 | |
588d5d01 P |
11 | int RSA_bits(const RSA *rsa); |
12 | ||
3dbf8243 MC |
13 | The following functions have been deprecated since OpenSSL 3.0, and can be |
14 | hidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, | |
15 | see L<openssl_user_macros(7)>: | |
4fd8a3e1 | 16 | |
6a2da303 | 17 | int RSA_size(const RSA *rsa); |
26c79d56 | 18 | |
f64f17c3 | 19 | int RSA_security_bits(const RSA *rsa); |
2186cd8e UM |
20 | |
21 | =head1 DESCRIPTION | |
22 | ||
588d5d01 P |
23 | RSA_bits() returns the number of significant bits. |
24 | ||
25 | B<rsa> and B<rsa-E<gt>n> must not be B<NULL>. | |
26 | ||
27 | The remaining functions described on this page are deprecated. | |
ed576acd TM |
28 | Applications should instead use L<EVP_PKEY_get_size(3)>, L<EVP_PKEY_get_bits(3)> |
29 | and L<EVP_PKEY_get_security_bits(3)>. | |
4fd8a3e1 | 30 | |
26c79d56 | 31 | RSA_size() returns the RSA modulus size in bytes. It can be used to |
2186cd8e UM |
32 | determine how much memory must be allocated for an RSA encrypted |
33 | value. | |
34 | ||
6a2da303 PY |
35 | RSA_security_bits() returns the number of security bits of the given B<rsa> |
36 | key. See L<BN_security_bits(3)>. | |
37 | ||
1f13ad31 | 38 | =head1 RETURN VALUES |
2186cd8e | 39 | |
588d5d01 | 40 | RSA_bits() returns the number of bits in the key. |
6a2da303 | 41 | |
588d5d01 | 42 | RSA_size() returns the size of modulus in bytes. |
6a2da303 PY |
43 | |
44 | RSA_security_bits() returns the number of security bits. | |
2186cd8e UM |
45 | |
46 | =head1 SEE ALSO | |
47 | ||
53934822 | 48 | L<BN_num_bits(3)> |
2186cd8e UM |
49 | |
50 | =head1 HISTORY | |
51 | ||
588d5d01 | 52 | The RSA_size() and RSA_security_bits() functions were deprecated in OpenSSL 3.0. |
4fd8a3e1 | 53 | |
fc5ecadd | 54 | The RSA_bits() function was added in OpenSSL 1.1.0. |
2186cd8e | 55 | |
e2f92610 RS |
56 | =head1 COPYRIGHT |
57 | ||
38fc02a7 | 58 | Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. |
e2f92610 | 59 | |
4746f25a | 60 | Licensed under the Apache License 2.0 (the "License"). You may not use |
e2f92610 RS |
61 | this file except in compliance with the License. You can obtain a copy |
62 | in the file LICENSE in the source distribution or at | |
63 | L<https://www.openssl.org/source/license.html>. | |
64 | ||
65 | =cut |