OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu

Jak sprawdzić, czy klucz prywatny pasuje do wydanego certyfikatu? Powinny posiadać identyczny skrót SHA256:

1
openssl rsa -noout -modulus -in kluczdomeny.key 2> /dev/null | sha256sum -
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
1
openssl x509 -noout -modulus -in certyfikat.crt 2> /dev/null | sha256sum -
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -

Jeśli jest inaczej to znaczy, że coś poszło nie tak w procesie generowania certyfikatu lub pomyliliśmy pliki.

2 (1)
Article Rating (1 Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
Check a Website Availability from the Linux Command Line
Viewed 7767 times since Mon, Feb 18, 2019
Manage Linux Password Expiration and Aging Using chage
Viewed 6158 times since Tue, Sep 11, 2018
RHEL: Route network packets to go out via the same interface they came in
Viewed 4200 times since Sat, Jun 2, 2018
Create a Linux Swap File
Viewed 3759 times since Fri, Jun 8, 2018
RHCS6: Show/Add GFS2/GFS journals
Viewed 13454 times since Sun, Jun 3, 2018
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 11115 times since Sun, Nov 22, 2020
RHEL: Checking HBAs
Viewed 16443 times since Sun, May 27, 2018
Red Hat Enterprise Linux - Allow Root Login From a Specific IP Address Only
Viewed 3636 times since Wed, Oct 3, 2018
CentOS / RHEL : Configure yum automatic updates with yum-cron service
Viewed 4186 times since Fri, Oct 26, 2018
Prosty skaner portów TCP w bash
Viewed 3986 times since Thu, May 24, 2018