1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimRSA_size, RSA_bits, RSA_security_bits - get RSA modulus size or security bits 6e71b7053SJung-uk Kim 7e71b7053SJung-uk Kim=head1 SYNOPSIS 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim #include <openssl/rsa.h> 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim int RSA_bits(const RSA *rsa); 12e71b7053SJung-uk Kim 13*b077aed3SPierre ProncheryThe following functions have been deprecated since OpenSSL 3.0, and can be 14*b077aed3SPierre Proncheryhidden entirely by defining B<OPENSSL_API_COMPAT> with a suitable version value, 15*b077aed3SPierre Proncherysee L<openssl_user_macros(7)>: 16*b077aed3SPierre Pronchery 17*b077aed3SPierre Pronchery int RSA_size(const RSA *rsa); 18*b077aed3SPierre Pronchery 19*b077aed3SPierre Pronchery int RSA_security_bits(const RSA *rsa); 20e71b7053SJung-uk Kim 21e71b7053SJung-uk Kim=head1 DESCRIPTION 22e71b7053SJung-uk Kim 23e71b7053SJung-uk KimRSA_bits() returns the number of significant bits. 24e71b7053SJung-uk Kim 25e71b7053SJung-uk KimB<rsa> and B<rsa-E<gt>n> must not be B<NULL>. 26e71b7053SJung-uk Kim 27*b077aed3SPierre ProncheryThe remaining functions described on this page are deprecated. 28*b077aed3SPierre ProncheryApplications should instead use L<EVP_PKEY_get_size(3)>, L<EVP_PKEY_get_bits(3)> 29*b077aed3SPierre Proncheryand L<EVP_PKEY_get_security_bits(3)>. 30*b077aed3SPierre Pronchery 31*b077aed3SPierre ProncheryRSA_size() returns the RSA modulus size in bytes. It can be used to 32*b077aed3SPierre Proncherydetermine how much memory must be allocated for an RSA encrypted 33*b077aed3SPierre Proncheryvalue. 34*b077aed3SPierre Pronchery 35e71b7053SJung-uk KimRSA_security_bits() returns the number of security bits of the given B<rsa> 36e71b7053SJung-uk Kimkey. See L<BN_security_bits(3)>. 37e71b7053SJung-uk Kim 38e71b7053SJung-uk Kim=head1 RETURN VALUES 39e71b7053SJung-uk Kim 40*b077aed3SPierre ProncheryRSA_bits() returns the number of bits in the key. 41e71b7053SJung-uk Kim 42*b077aed3SPierre ProncheryRSA_size() returns the size of modulus in bytes. 43e71b7053SJung-uk Kim 44e71b7053SJung-uk KimRSA_security_bits() returns the number of security bits. 45e71b7053SJung-uk Kim 46e71b7053SJung-uk Kim=head1 SEE ALSO 47e71b7053SJung-uk Kim 48e71b7053SJung-uk KimL<BN_num_bits(3)> 49e71b7053SJung-uk Kim 50e71b7053SJung-uk Kim=head1 HISTORY 51e71b7053SJung-uk Kim 52*b077aed3SPierre ProncheryThe RSA_size() and RSA_security_bits() functions were deprecated in OpenSSL 3.0. 53*b077aed3SPierre Pronchery 546935a639SJung-uk KimThe RSA_bits() function was added in OpenSSL 1.1.0. 55e71b7053SJung-uk Kim 56e71b7053SJung-uk Kim=head1 COPYRIGHT 57e71b7053SJung-uk Kim 58*b077aed3SPierre ProncheryCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved. 59e71b7053SJung-uk Kim 60*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 61e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 62e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 63e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 64e71b7053SJung-uk Kim 65e71b7053SJung-uk Kim=cut 66