Skip to content

Commit

Permalink
add Caps type to gpg-keys and dummy parse-func
Browse files Browse the repository at this point in the history
RELEASE_NOTES=[FEATURE] Add GPG key capabilities and check in key.isUsable

Signed-off-by: Thomas Mantl <thomas.mantl@redgears.net>
  • Loading branch information
TM2500 committed Nov 25, 2021
1 parent f64d5e3 commit b8fe05a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/backend/crypto/gpg/colons/parse_colons.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ func Parse(reader io.Reader) gpg.KeyList {
return kl
}

func parseKeyCaps(fields []string) gpg.Capabilities {

}

func parseColonIdentity(fields []string) gpg.Identity {
for i, f := range fields {
fields[i] = strings.Replace(f, "\\x3a", ":", -1)
Expand Down
9 changes: 9 additions & 0 deletions internal/backend/crypto/gpg/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ type Key struct {
Fingerprint string
Identities map[string]Identity
SubKeys map[string]struct{}
Caps Capabilities
}

// Capabilities of a Key
type Capabilities struct {
Encrypt bool
Sign bool
Certify bool
Authentication bool
}

// IsUseable returns true if GPG would assume this key is useable for encryption
Expand Down

0 comments on commit b8fe05a

Please sign in to comment.