Merge pull request #232 from wishdev/fingerprint

Add root fingerprint to pki if certificate given
This commit is contained in:
Max 2020-04-23 14:49:06 -07:00 committed by GitHub
commit 59a57d487b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -289,6 +289,10 @@ func (p *PKI) WriteRootCertificate(rootCrt *x509.Certificate, rootKey interface{
if err != nil { if err != nil {
return err return err
} }
sum := sha256.Sum256(rootCrt.Raw)
p.rootFingerprint = strings.ToLower(hex.EncodeToString(sum[:]))
return nil return nil
} }