forked from TrueCloudLab/certificates
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.
This commit is contained in:
parent
00998d053d
commit
d1f78cf6d2
1 changed files with 4 additions and 0 deletions
|
@ -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…
Reference in a new issue