PublicKeyFingerprint returns the hex-encoded SHA-256 digest of the certificate's SubjectPublicKeyInfo. It depends only on the public key, so two certificates that share a key produce the same fingerprint. Note that the operator generates a fresh key on every restart, so its fingerprint is not stable
(cert *x509.Certificate)
| 93 | // share a key produce the same fingerprint. Note that the operator generates a fresh |
| 94 | // key on every restart, so its fingerprint is not stable across restarts. |
| 95 | func PublicKeyFingerprint(cert *x509.Certificate) string { |
| 96 | digest := sha256.Sum256(cert.RawSubjectPublicKeyInfo) |
| 97 | return hex.EncodeToString(digest[:]) |
| 98 | } |
no outgoing calls
no test coverage detected