int RSA_check_key(RSA *rsa);
=head1 DESCRIPTION
This function validates RSA keys. It checks that B and B are
in fact prime, and that B.
It also checks that B,
and that B, B and B are set correctly or are B.
The key's public components may not be B.
=head1 RETURN VALUE
RSA_check_key() returns 1 if B is a valid RSA key, and 0 otherwise.
-1 is returned if an error occurs while checking the key.
If the key is invalid or an error occurred, the reason code can be
obtained using L.
=head1 NOTES
RSA_check_key() can only check soft keys. If given hard keys, i.e. keys
that were retreived from an ENGINE (with ENGINE_load_private_key()),
RSA_check_key() will always return 0, as if the key was invalid. The
reason is that the private components B

, B and B are normally
not available to OpenSSL for hard keys, and the checks can therefore not
be done.
=head1 SEE ALSO
L, L
=head1 HISTORY
RSA_check_key() appeared in OpenSSL 0.9.4.
=cut