Table of Contents generated with DocToc
Retrieve the latest public keys (example with wget):
wget https://raw.githubusercontent.com/IBM/cloud-pak-cli/master/certificates/cloudctl.pem.cer
wget https://raw.githubusercontent.com/IBM/cloud-pak-cli/master/certificates/cloudctl.pem.chain
wget https://raw.githubusercontent.com/IBM/cloud-pak-cli/master/certificates/cloudctl.pem.pub.key
Note: On windows, run below commands from Git Bash
openssl x509 -inform pem -in cloudctl.pem.cer -noout -text
openssl ocsp -no_nonce -issuer cloudctl.pem.chain -cert cloudctl.pem.cer -VAfile cloudctl.pem.chain -text -url http://ocsp.digicert.com -respout ocsptest
Should see a message that contains:
Response verify OK
openssl rsa -noout -text -inform PEM -in cloudctl.pem.pub.key -pubin
Make a note of modulus and Exponent
openssl x509 -inform pem -in cloudctl.pem.cer -noout -text
Check the Public-Key
section in the output and compare with previous result.
We will verify cloudctl-linux-amd64.tar.gz. Steps will be same for other archives.
Convert the signature from base64 to bytes
export ARCHIVE=cloudctl-linux-amd64.tar.gz
openssl enc -d -A -base64 -in "${ARCHIVE}.sig" -out "/tmp/${ARCHIVE}.decoded.sig"
Verify the signature bytes:
export ARCHIVE=cloudctl-linux-amd64.tar.gz
openssl dgst -verify cloudctl.pem.pub.key -keyform PEM -sha256 -signature "/tmp/${ARCHIVE}.decoded.sig" -binary "${ARCHIVE}"