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:
parent
f2d8cd1e90
commit
9cf4a7cb5c
3 changed files with 20 additions and 10 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||
"github.com/csaf-poc/csaf_distribution/csaf"
|
||||
)
|
||||
|
||||
|
|
@ -70,6 +71,15 @@ func (cfg *config) modelTLPs() []csaf.TLPLabel {
|
|||
return tlps
|
||||
}
|
||||
|
||||
func (cfg *config) loadCryptoKey() (*crypto.Key, error) {
|
||||
f, err := os.Open(cfg.Key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
return crypto.NewKeyFromArmoredReader(f)
|
||||
}
|
||||
|
||||
func loadConfig() (*config, error) {
|
||||
path := os.Getenv(configEnv)
|
||||
if path == "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue