Documentation ¶
Overview ¶
Package cli implements a GPG CLI crypto backend.
Index ¶
- Variables
- type Config
- type GPG
- func (g *GPG) Binary() string
- func (g *GPG) Concurrency() int
- func (g *GPG) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)
- 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) FindIdentities(ctx context.Context, search ...string) ([]string, error)
- func (g *GPG) FindRecipients(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, tpl string) string
- func (g *GPG) GenerateIdentity(ctx context.Context, name, email, passphrase string) error
- 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) ListIdentities(ctx context.Context) ([]string, error)
- func (g *GPG) ListRecipients(ctx context.Context) ([]string, error)
- func (g *GPG) Name() 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" // Name is the name of this backend. Name = "gpg" )
Functions ¶
This section is empty.
Types ¶
type GPG ¶
type GPG struct {
// contains filtered or unexported fields
}
GPG is a gpg wrapper.
func (*GPG) Concurrency ¶ added in v1.13.0
Concurrency returns 1 to avoid concurrency issues with many GPG setups.
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) FindIdentities ¶
FindIdentities searches for the given private keys.
func (*GPG) FindRecipients ¶
FindRecipients searches for the given public keys.
func (*GPG) Fingerprint ¶
Fingerprint returns the fingerprint.
func (*GPG) FormatKey ¶
FormatKey formats the details of a key id Examples: - NameFromKey: {{ .Name }} - EmailFromKey: {{ .Email }}.
func (*GPG) GenerateIdentity ¶
GenerateIdentity will create a new GPG keypair in batch mode.
func (*GPG) ImportPublicKey ¶
ImportPublicKey will import a key from the given location into the keyring.
func (*GPG) Initialized ¶
Initialized always returns nil.
func (*GPG) ListIdentities ¶
ListIdentities returns a parsed list of GPG secret keys.
func (*GPG) ListRecipients ¶
ListRecipients returns a parsed list of GPG public keys.
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 encrypted blob.