Documentation ¶
Index ¶
- Variables
- func IsAlwaysTrust(ctx context.Context) bool
- func UseCache(ctx context.Context) bool
- func WithAlwaysTrust(ctx context.Context, at bool) context.Context
- func WithUseCache(ctx context.Context, nc bool) context.Context
- type Capabilities
- type Identity
- type Key
- type KeyList
- func (kl KeyList) FindKey(id string) (Key, error)
- func (kl KeyList) Len() int
- func (kl KeyList) Less(i, j int) bool
- func (kl KeyList) Recipients() []string
- func (kl KeyList) Swap(i, j int)
- func (kl KeyList) UnusableKeys(alwaysTrust bool) KeyList
- func (kl KeyList) UseableKeys(alwaysTrust bool) KeyList
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotFound = fmt.Errorf("no matching key found")
ErrKeyNotFound is returned when a key is not found.
Functions ¶
func IsAlwaysTrust ¶
IsAlwaysTrust will return the value of the always trust flag or the default (false).
func WithAlwaysTrust ¶
WithAlwaysTrust will return a context with the flag for always trust set.
Types ¶
type Capabilities ¶ added in v1.14.0
type Capabilities struct { Encrypt bool Sign bool Certify bool Authentication bool Deactivated bool }
Capabilities of a Key.
type Identity ¶
type Identity struct { Name string Comment string Email string CreationDate time.Time ExpirationDate time.Time }
Identity is a GPG identity, one key can have many IDs.
type Key ¶
type Key struct { KeyType string KeyLength int Validity string CreationDate time.Time ExpirationDate time.Time Ownertrust string Fingerprint string Identities map[string]Identity SubKeys map[string]struct{} Caps Capabilities }
Key is a GPG key (public or secret).
func (Key) IsUseable ¶
IsUseable returns true if GPG would assume this key is useable for encryption.
type KeyList ¶
type KeyList []Key
KeyList is a searchable slice of Keys.
func (KeyList) Recipients ¶
Recipients returns the KeyList formatted as a recipient list.
func (KeyList) UnusableKeys ¶
UnusableKeys returns the list of unusable keys (invalid keys).
func (KeyList) UseableKeys ¶
UseableKeys returns the list of useable (valid keys).
Click to show internal directories.
Click to hide internal directories.