RSA_check_key.pod 817 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. =pod
  2. =head1 NAME
  3. RSA_check_key - validate private RSA keys
  4. =head1 SYNOPSIS
  5. #include <openssl/rsa.h>
  6. int RSA_check_key(RSA *rsa);
  7. =head1 DESCRIPTION
  8. This function validates RSA keys. It checks that B<p> and B<q> are
  9. in fact prime, and that B<n = p*q>.
  10. It also checks that B<d*e = 1 mod (p-1*q-1)>,
  11. and that B<dmp1>, B<dmq1> and B<iqmp> are set correctly or are B<NULL>.
  12. The key's public components may not be B<NULL>.
  13. =head1 RETURN VALUE
  14. RSA_check_key() returns 1 if B<rsa> is a valid RSA key, and 0 otherwise.
  15. -1 is returned if an error occurs while checking the key.
  16. If the key is invalid or an error occurred, the reason code can be
  17. obtained using L<ERR_get_error(3)|ERR_get_error(3)>.
  18. =head1 SEE ALSO
  19. L<rsa(3)|rsa(3)>, L<err(3)|err(3)>
  20. =head1 HISTORY
  21. RSA_check() appeared in OpenSSL 0.9.4.
  22. =cut