Add root fingerprint to pki if certificate given

If a root certificate is provided to init an authority the fingerprint
is not currently stored in the default.json file. This patch simply
stores the fingerprint of the supplied certificate.
pull/232/head
John W Higgins 4 years ago
parent 00998d053d
commit d1f78cf6d2

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

Loading…
Cancel
Save