openpgp

package
v1.7.0-alpha.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GPG

type GPG struct {
	// contains filtered or unexported fields
}

GPG is a pure-Go GPG backend

func New

func New(ctx context.Context) (*GPG, error)

New creates a new pure-Go GPG backend

func (*GPG) Binary

func (g *GPG) Binary() string

Binary always returns ”

func (*GPG) CreatePrivateKey

func (g *GPG) CreatePrivateKey(ctx context.Context) error

CreatePrivateKey is not implemented

func (*GPG) CreatePrivateKeyBatch

func (g *GPG) CreatePrivateKeyBatch(ctx context.Context, name, email, pw string) error

CreatePrivateKeyBatch is not implemented

func (*GPG) Decrypt

func (g *GPG) Decrypt(ctx context.Context, ciphertext []byte) ([]byte, error)

Decrypt decryptes the ciphertext see https://gist.github.com/stuart-warren/93750a142d3de4e8fdd2

func (*GPG) DecryptionKeys

func (g *GPG) DecryptionKeys() []openpgp.Key

DecryptionKeys implements openpgp.Keyring

func (*GPG) EmailFromKey

func (g *GPG) EmailFromKey(ctx context.Context, id string) string

EmailFromKey returns the email for this key

func (*GPG) Encrypt

func (g *GPG) Encrypt(ctx context.Context, plaintext []byte, recipients []string) ([]byte, error)

Encrypt encrypts the plaintext for the given recipients

func (*GPG) ExportPublicKey

func (g *GPG) ExportPublicKey(ctx context.Context, id string) ([]byte, error)

ExportPublicKey does nothing

func (*GPG) Ext

func (g *GPG) Ext() string

Ext returns gpg

func (*GPG) FindPrivateKeys

func (g *GPG) FindPrivateKeys(ctx context.Context, keys ...string) ([]string, error)

FindPrivateKeys does nothing

func (*GPG) FindPublicKeys

func (g *GPG) FindPublicKeys(ctx context.Context, keys ...string) ([]string, error)

FindPublicKeys does nothing

func (*GPG) Fingerprint

func (g *GPG) Fingerprint(ctx context.Context, id string) string

Fingerprint returns the full-length native fingerprint

func (*GPG) FormatKey

func (g *GPG) FormatKey(ctx context.Context, id string) string

FormatKey returns the id

func (*GPG) IDFile

func (g *GPG) IDFile() string

IDFile returns .gpg-id

func (*GPG) ImportPublicKey

func (g *GPG) ImportPublicKey(ctx context.Context, buf []byte) error

ImportPublicKey does nothing

func (*GPG) Initialized

func (g *GPG) Initialized(context.Context) error

Initialized returns nil

func (*GPG) KeysById

func (g *GPG) KeysById(id uint64) []openpgp.Key

KeysById implements openpgp.Keyring

func (*GPG) KeysByIdUsage

func (g *GPG) KeysByIdUsage(id uint64, requiredUsage byte) []openpgp.Key

KeysByIdUsage implements openpgp.Keyring

func (*GPG) ListPrivateKeyIDs

func (g *GPG) ListPrivateKeyIDs(context.Context) ([]string, error)

ListPrivateKeyIDs does nothing

func (*GPG) ListPublicKeyIDs

func (g *GPG) ListPublicKeyIDs(context.Context) ([]string, error)

ListPublicKeyIDs does nothing

func (*GPG) Name

func (g *GPG) Name() string

Name returns openpgp

func (*GPG) NameFromKey

func (g *GPG) NameFromKey(ctx context.Context, id string) string

NameFromKey is returns the name for this key

func (*GPG) ReadNamesFromKey

func (g *GPG) ReadNamesFromKey(ctx context.Context, buf []byte) ([]string, error)

ReadNamesFromKey unmarshals and returns the names associated with the given public key

func (*GPG) RecipientIDs

func (g *GPG) RecipientIDs(ctx context.Context, ciphertext []byte) ([]string, error)

RecipientIDs returns the recipients of the encrypted message

func (*GPG) Sign

func (g *GPG) Sign(ctx context.Context, in string, sigf string) error

Sign is not implemented

func (*GPG) SigningKeys

func (g *GPG) SigningKeys() []openpgp.Key

SigningKeys returns a list of signing keys

func (*GPG) Verify

func (g *GPG) Verify(ctx context.Context, sigf string, in string) error

Verify is not implemented

func (*GPG) Version

func (g *GPG) Version(context.Context) semver.Version

Version returns dummy version info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL