How to determine if a private key belongs to a public certificate
This document (7015500) is provided subject to the disclaimer at the end of this document.
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 12
Determine key values mismatch of private and public keys.
Follow the steps below in a terminal window to verify a public and private key are a pair:
- openssl x509 -noout -modulus -in <public.crt> | openssl md5 > /tmp/crt.pub
Note: Replace <public.crt> with the filename of the public certificate.
- openssl rsa -noout -modulus -in <private.key> | openssl md5 > /tmp/key.pub
Note: Replace <private.key> with the filename of the private key. Enter the password if prompted.
- diff /tmp/crt.pub /tmp/key.pub
Note: If nothing is printed to the console, they were found to be a pair. Any differences are printed to the console in detail.
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7015500
- Creation Date: 08-Aug-2014
- Modified Date:03-Mar-2020
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: firstname.lastname@example.org