GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
X509_CHECK_PRIVATE_KEY(3) OpenSSL X509_CHECK_PRIVATE_KEY(3)

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

 #include <openssl/x509.h>

 int X509_check_private_key(X509 *x, EVP_PKEY *k);

 int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k);

X509_check_private_key() function checks the consistency of private key k with the public key in x.

X509_REQ_check_private_key() is equivalent to X509_check_private_key() except that x represents a certificate request of structure X509_REQ.

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 ERR_get_error(3).

The check_private_key functions don't check if k itself is indeed a private key or not. It merely compares 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 if you pass a public key to these functions in k, it will return success.

ERR_get_error(3)

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

Licensed under the OpenSSL license (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 <https://www.openssl.org/source/license.html>.

2022-05-03 1.1.1o

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.