OpenSSL, compare certificate vs. private key

To view the certificate Modulus:

openssl x509 -noout -modulus -in [certificate-file.crt]

To view the key Modulus:

openssl rsa -noout -modulus -in [key-file.key]

Command to compare certificate vs private key

$ certMod=$(openssl x509 -text -noout -modulus -in server.crt | grep "Modulus=") && \
	keyMod=$(openssl rsa -text -noout -modulus -in server.key | grep "Modulus=") && \
	[[ $certMod == $keyMod ]] && echo "Equal"

Tribut to Peter Mescalchin magnetikonline for the script above https://gist.github.com/magnetikonline/fbdb26fcb34ca5038c03507cbdfdb534

Publicerat i PKI

Openssl – parse certificate and crl files

Parse certificate in binary format

openssl x509 -in certfile.cer -text -noout -inform der

Parse crl in binary format

openssl crl -in crlfile.crl -text -noout -inform der

Parse PEM file with several certificates

openssl crl2pkcs7 -nocrl -certfile FILE.pem | \
openssl pkcs7 -print_certs
Publicerat i PKI

Homebrew

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Check your system for potential problems

$ brew doctor

Fetch the newest version of Homebrew

$ brew update

List all installed formulae

$ brew list

Install formulae

$ brew install [package]