Created
June 19, 2019 04:57
-
-
Save k-oguma/95b9fd7442c30fa2e12514982da0826d to your computer and use it in GitHub Desktop.
[oneliner][openssl] You can compare TLS CSR and TLS key by using one liner.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
domain=<Your domain>; [[ $(openssl rsa -text -noout -in $domain.key | grep -A 3 -w modulus: | tail -1 | grep $(openssl req -text -noout -in $domain.csr | grep -A 3 -w Modulus: | tail -1)) ]] && { echo -e "\033[32m[Success] Compared $domain.{key,csr}, these had each matched the module.\033[00m" } || { echo "\033[31m[Fail] Compared $domain.{key,csr}, these don't have each matched the module.\033[00m" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment