1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Add OpenPGP key to provider metadata when generated at setup.

This commit is contained in:
Sascha L. Teichmann 2021-12-01 20:16:09 +01:00
parent f2d8cd1e90
commit 9cf4a7cb5c
3 changed files with 20 additions and 10 deletions

View file

@ -95,5 +95,14 @@ func createProviderMetadata(c *config, wellknownCSAF string) error {
}
pm := csaf.NewProviderMetadataDomain(c.Domain, c.modelTLPs())
pm.Publisher = c.Publisher
// Set OpenPGP key.
key, err := c.loadCryptoKey()
if err != nil {
return err
}
fingerprint := key.GetFingerprint()
pm.SetPGP(fingerprint, c.GetOpenPGPURL(fingerprint))
return saveToFile(path, pm)
}