Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Check If Certificate, Private Key and CSR Match

    How to Check If Certificate, Private Key and CSR Match

    By RahulOctober 23, 20172 Mins Read

    This tutorial is helpful to verify that you are using correct Private key, or Certificate. You may face an issue when your certificate does not match to the private key and throws an error.

    Advertisement

    Method 1 – Using OpenSSL and MD5

    In the first method, The md5 value of certificate, key, and CSR should be same for all to work properly. If any of md5 is different means that file doesn’t relate to others.

    $ openssl rsa -noout -modulus -in example.key | openssl md5
    $ openssl req -noout -modulus -in example.csr | openssl md5
    $ openssl x509 -noout -modulus -in example.crt | openssl md5
    

    For example, check the md5 values are same for all the keys. It means they are related to each other and work properly.

    Method 2 – Using Openssl and sha256sum

    Second method check for the SHA sum values of all files and check if the value of all files are same.

    $ openssl pkey -in example.key -pubout -outform pem | sha256sum
    $ openssl x509 -in example.crt -pubkey -noout -outform pem | sha256sum
    $ openssl req -in example.csr -pubkey -noout -outform pem | sha256sum 
    

    For example, check the sha2 sum values are same for all the keys. It means they are related to each other and work properly.

    certificate csr private key SSL
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Split Large Archives in Linux using the Command Line

    System.out.println() Method in Java: A Beginner’s Guide

    sleep Command in Linux with Examples

    View 2 Comments

    2 Comments

    1. liviu on February 17, 2019 9:30 pm

      god bless you

      Reply
    2. ahmed on June 23, 2018 5:43 am

      good article mate it saved time for me thanks
      you rock

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.