Check

openssl pkey -pubout -outform pem -in example.com.key | sha256sum
777cbe691bc3e3273342a7e85d124c102f567875d83f6f586ddf31effb47bbd4  -

openssl x509 -pubkey -noout -outform pem -in example.com.crt.pem | sha256sum
777cbe691bc3e3273342a7e85d124c102f567875d83f6f586ddf31effb47bbd4  -