Documentation ¶
Index ¶
- Variables
- func Binary(ctx context.Context, bin string) (string, error)
- func GPGOpts() []string
- type Config
- type GPG
- func (g *GPG) Binary() string
- func (g *GPG) CreatePrivateKey(ctx context.Context) error
- func (g *GPG) CreatePrivateKeyBatch(ctx context.Context, name, email, passphrase string) error
- func (g *GPG) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
- func (g *GPG) EmailFromKey(ctx context.Context, id string) string
- func (g *GPG) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, error)
- func (g *GPG) ExportPublicKey(ctx context.Context, id string) ([]byte, error)
- func (g *GPG) Ext() string
- func (g *GPG) FindPrivateKeys(ctx context.Context, search ...string) ([]string, error)
- func (g *GPG) FindPublicKeys(ctx context.Context, search ...string) ([]string, error)
- func (g *GPG) Fingerprint(ctx context.Context, id string) string
- func (g *GPG) FormatKey(ctx context.Context, id string) string
- func (g *GPG) IDFile() string
- func (g *GPG) ImportPublicKey(ctx context.Context, buf []byte) error
- func (g *GPG) Initialized(ctx context.Context) error
- func (g *GPG) ListPrivateKeyIDs(ctx context.Context) ([]string, error)
- func (g *GPG) ListPublicKeyIDs(ctx context.Context) ([]string, error)
- func (g *GPG) Name() string
- func (g *GPG) NameFromKey(ctx context.Context, id string) string
- func (g *GPG) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)
- func (g *GPG) RecipientIDs(ctx context.Context, buf []byte) ([]string, error)
- func (g *GPG) Version(ctx context.Context) semver.Version
Constants ¶
This section is empty.
Variables ¶
var ( // Ext is the file extension used by this backend Ext = "gpg" // IDFile is the name of the recipients file used by this backend IDFile = ".gpg-id" )
Functions ¶
Types ¶
type GPG ¶
type GPG struct {
// contains filtered or unexported fields
}
GPG is a gpg wrapper
func (*GPG) CreatePrivateKey ¶
CreatePrivateKey will create a new GPG key in interactive mode
func (*GPG) CreatePrivateKeyBatch ¶
CreatePrivateKeyBatch will create a new GPG keypair in batch mode
func (*GPG) EmailFromKey ¶
EmailFromKey extracts the email from a key id
func (*GPG) Encrypt ¶
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) "unusable public key" errors when encrypting.
func (*GPG) ExportPublicKey ¶
ExportPublicKey will export the named public key to the location given
func (*GPG) FindPrivateKeys ¶
FindPrivateKeys searches for the given private keys
func (*GPG) FindPublicKeys ¶
FindPublicKeys searches for the given public keys
func (*GPG) Fingerprint ¶
Fingerprint returns the full-length native fingerprint
func (*GPG) ImportPublicKey ¶
ImportPublicKey will import a key from the given location
func (*GPG) Initialized ¶
Initialized always returns nil
func (*GPG) ListPrivateKeyIDs ¶
ListPrivateKeyIDs returns a parsed list of GPG secret keys
func (*GPG) ListPublicKeyIDs ¶
ListPublicKeyIDs returns a parsed list of GPG public keys
func (*GPG) NameFromKey ¶
NameFromKey extracts the name from a key id
func (*GPG) ReadNamesFromKey ¶
ReadNamesFromKey unmarshals and returns the names associated with the given public key
func (*GPG) RecipientIDs ¶
RecipientIDs returns a list of recipient IDs for a given file