Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 796efcf
  • /
  • doc
  • /
  • man3
  • /
  • X509_check_private_key.pod
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:67911cb6a4ba7a07a042402ff6addff663373591
directory badge Iframe embedding
swh:1:dir:824a99e9eb1eef93d48b8907bd1e34d2a8d3282c
X509_check_private_key.pod
=pod

=head1 NAME

X509_check_private_key, X509_REQ_check_private_key - check the consistency
of a private key with the public key in an X509 certificate or certificate
request

=head1 SYNOPSIS

 #include <openssl/x509.h>

 int X509_check_private_key(const X509 *cert, EVP_PKEY *pkey);

 int X509_REQ_check_private_key(X509_REQ *req, EVP_PKEY *pkey);

=head1 DESCRIPTION

X509_check_private_key() function checks the consistency of private
key I<pkey> with the public key in I<cert>.

X509_REQ_check_private_key() is equivalent to X509_check_private_key()
except that I<req> represents a certificate request of structure B<X509_REQ>.

=head1 RETURN VALUES

X509_check_private_key() and X509_REQ_check_private_key() return 1 if
the keys match each other, and 0 if not.

If the key is invalid or an error occurred, the reason code can be
obtained using L<ERR_get_error(3)>.

=head1 BUGS

The X509_check_private_key() and X509_REQ_check_private_key() functions
do not check if I<pkey> itself is indeed a private key or not.
They merely compare the public materials (e.g., exponent and modulus of an RSA
key) and/or key parameters (e.g. EC params of an EC key) of a key pair.
So they also return success if I<pkey> is a matching public key.

=head1 SEE ALSO

L<ERR_get_error(3)>

=head1 COPYRIGHT

Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top