mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
- #309 adding gpgKeys config key, accepting array of keyRef, cli args has precedence
- #691 adding handling of multiple keyRefs when signing with gpg
This commit is contained in:
+8
-4
@@ -22,7 +22,7 @@ var (
|
||||
type GpgSigner struct {
|
||||
gpg string
|
||||
version GPGVersion
|
||||
keyRef string
|
||||
keyRefs []string
|
||||
keyring, secretKeyring string
|
||||
passphrase, passphraseFile string
|
||||
batch bool
|
||||
@@ -35,7 +35,11 @@ func (g *GpgSigner) SetBatch(batch bool) {
|
||||
|
||||
// SetKey sets key ID to use when signing files
|
||||
func (g *GpgSigner) SetKey(keyRef string) {
|
||||
g.keyRef = keyRef
|
||||
if g.keyRefs == nil {
|
||||
g.keyRefs = []string{strings.TrimSpace(keyRef)}
|
||||
} else {
|
||||
g.keyRefs = append(g.keyRefs, strings.TrimSpace(keyRef))
|
||||
}
|
||||
}
|
||||
|
||||
// SetKeyRing allows to set custom keyring and secretkeyring
|
||||
@@ -57,8 +61,8 @@ func (g *GpgSigner) gpgArgs() []string {
|
||||
args = append(args, "--secret-keyring", g.secretKeyring)
|
||||
}
|
||||
|
||||
if g.keyRef != "" {
|
||||
args = append(args, "-u", g.keyRef)
|
||||
for _, k := range g.keyRefs {
|
||||
args = append(args, "-u", k)
|
||||
}
|
||||
|
||||
if g.passphrase != "" || g.passphraseFile != "" {
|
||||
|
||||
Reference in New Issue
Block a user