Documentation ¶
Index ¶
- type GPGStore
- func (gs *GPGStore) BulkDecrypt(filenames []string, progress ...bool) (filecontents map[string]string, err error)
- func (gs *GPGStore) Debug(on bool)
- func (gs *GPGStore) Decrypt(encrypted []byte) (decrypted []byte, err error)
- func (gs *GPGStore) Encrypt(unencrypted []byte) (encrypted []byte, err error)
- func (gs *GPGStore) Identity() string
- func (gs *GPGStore) Init(identity string, passphrase string) error
- func (gs *GPGStore) ListPrivateKeys() ([]string, error)
- func (gs *GPGStore) ListPublicKeys() ([]string, error)
- type IncorrectPassphrase
- type NoSuchKeyError
- type NoSuchKeyRingError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GPGStore ¶
type GPGStore struct {
// contains filtered or unexported fields
}
GPGStore is the basic store object.
func New ¶
New returns a new GPGStore. You can specify the verbosity (which uses logrus) and you can optionally specify a keyring folder to use to find secring.gpg and pubring.gpg. If the keyring folder is not supplied, or not found, it will search in the common places to find the correct folder and use that.
func (*GPGStore) BulkDecrypt ¶
func (gs *GPGStore) BulkDecrypt(filenames []string, progress ...bool) (filecontents map[string]string, err error)
BulkDecrypt takes a list of filenames and then decrypts them in parallel and then returns a map with filename keys and the decrypted file contents as values. Files which have errors are quietly skipped.
func (*GPGStore) Decrypt ¶
Decrypt uses the supplied GPG parameters to decrypt armor-encoded GPG data.
func (*GPGStore) Encrypt ¶
Encrypt takes a string and returns a string that is armor encoded using the supplied GPG credentials.
func (*GPGStore) Init ¶
Init uses the supplied identity and passphrase to determine the GPG parameters. The identity must be in the secret and public keychain, and returns an error otherwise. The passphrase is validated and returns an error if doesn't exist.
func (*GPGStore) ListPrivateKeys ¶
ListPrivateKeys returns a list of the names of keys available in the private key chain
func (*GPGStore) ListPublicKeys ¶
ListPublicKeys returns a list of the names of keys available in the public key chain
type IncorrectPassphrase ¶
type IncorrectPassphrase struct {
// contains filtered or unexported fields
}
IncorrectPassphrase is thrown when the supplied passphrase doesn't match for the key
func (IncorrectPassphrase) Error ¶
func (err IncorrectPassphrase) Error() string
type NoSuchKeyError ¶
type NoSuchKeyError struct {
// contains filtered or unexported fields
}
NoSuchKeyError is thrown when supplied GPG key name not available in private and public keychains
func (NoSuchKeyError) Error ¶
func (err NoSuchKeyError) Error() string
type NoSuchKeyRingError ¶
type NoSuchKeyRingError struct {
// contains filtered or unexported fields
}
NoSuchKeyRing is thrown when supplied keyring containing the secret and public keys cannot be found
func (NoSuchKeyRingError) Error ¶
func (err NoSuchKeyRingError) Error() string