pub fn spki_hash(spki: &SubjectPublicKeyInfoDer<'_>) -> StringExpand description
Calculates Subject Public Key Info SHA-256 hash and returns it as base64.
This is the same format as used in https://www.rfc-editor.org/rfc/rfc7469. You can calculate the same hash for any remote host with
openssl s_client -connect "$HOST:993" -servername "$HOST" </dev/null 2>/dev/null |
openssl x509 -pubkey -noout |
openssl pkey -pubin -outform der |
openssl dgst -sha256 -binary |
openssl enc -base64