Documentation ¶
Index ¶
- type Config
- type GPG
- func (g *GPG) Decrypt(path string) ([]byte, error)
- func (g *GPG) Encrypt(path string, content []byte, recipients []string) error
- func (g *GPG) ExportPublicKey(id, filename string) error
- func (g *GPG) FindPrivateKeys(search ...string) (KeyList, error)
- func (g *GPG) FindPublicKeys(search ...string) (KeyList, error)
- func (g *GPG) GetRecipients(file string) ([]string, error)
- func (g *GPG) ImportPublicKey(filename string) error
- func (g *GPG) ListPrivateKeys() (KeyList, error)
- func (g *GPG) ListPublicKeys() (KeyList, error)
- type Identity
- type Key
- type KeyList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GPG ¶ added in v1.2.0
type GPG struct {
// contains filtered or unexported fields
}
GPG is a gpg wrapper
func (*GPG) Encrypt ¶ added in v1.2.0
Encrypt will encrypt the given content for the recipients. If alwaysTrust is true the trust-model will be set to always as to avoid (annoying) "unuseable public key" errors when encrypting.
func (*GPG) ExportPublicKey ¶ added in v1.2.0
ExportPublicKey will export the named public key to the location given
func (*GPG) FindPrivateKeys ¶ added in v1.2.0
FindPrivateKeys searches for the given private keys
func (*GPG) FindPublicKeys ¶ added in v1.2.0
FindPublicKeys searches for the given public keys
func (*GPG) GetRecipients ¶ added in v1.2.0
GetRecipients returns a list of recipient IDs for a given file
func (*GPG) ImportPublicKey ¶ added in v1.2.0
ImportPublicKey will import a key from the given location
func (*GPG) ListPrivateKeys ¶ added in v1.2.0
ListPrivateKeys returns a parsed list of GPG secret keys
func (*GPG) ListPublicKeys ¶ added in v1.2.0
ListPublicKeys returns a parsed list of GPG public keys
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{} }
Key is a GPG key (public or secret)
func (Key) IsUseable ¶
IsUseable returns true if GPG would assume this key is useable for encryption