openpgp

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrypterFromKey

func CrypterFromKey(armoredKey string, loadPassphrase func() (string, bool)) crypto.Crypter

CrypterFromKey creates Crypter from armored key.

func CrypterFromKeyPath

func CrypterFromKeyPath(armoredKeyPath string, loadPassphrase func() (string, bool)) crypto.Crypter

CrypterFromKeyPath creates Crypter from armored key path.

func CrypterFromKeyRingID

func CrypterFromKeyRingID(keyRingID string, loadPassphrase func() (string, bool)) crypto.Crypter

CrypterFromKeyRingID create Crypter from key ring ID.

Types

type Crypter

type Crypter struct {
	KeyRingID      string
	IsUseKeyRingID bool

	ArmoredKey      string
	IsUseArmoredKey bool

	ArmoredKeyPath      string
	IsUseArmoredKeyPath bool

	PubKey    openpgp.EntityList
	SecretKey openpgp.EntityList
	// contains filtered or unexported fields
}

Crypter incapsulates specific of cypher method Includes keys, infrastructure information etc If many encryption methods will be used it worth to extract interface

func (*Crypter) Decrypt

func (crypter *Crypter) Decrypt(reader io.Reader) (io.Reader, error)

Decrypt creates decrypted reader from ordinary reader

func (*Crypter) Encrypt

func (crypter *Crypter) Encrypt(writer io.Writer) (io.WriteCloser, error)

Encrypt creates encryption writer from ordinary writer

Jump to

Keyboard shortcuts

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