openpgp

package
v0.0.0-...-1b2fc92 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenPGP

type OpenPGP struct {

	// If your key doesn't have a pass phrase, leave it empty.
	PassPhrase string `json:"pass_phrase"`

	// A reader to the private key file.
	// If not set then decryption will not be possible.
	PrivateKey io.Reader

	// Will read the private key from a file if set.
	PrivateKeyPath string `json:"private_key"`

	// A reader to the public key file.
	// If not set then encryption will not be possible.
	PublicKey io.Reader

	// Will read the public key from a file if set.
	PublicKeyPath string `json:"public_key"`
	// contains filtered or unexported fields
}

OpenPGP Encrypt and Decrypt with a key pair. The file gen.sh in the child directory 'openpgp' gives an example on how to generate a PGP key pair.

func (*OpenPGP) Decode

func (o *OpenPGP) Decode(r io.Reader, w io.Writer) error

Decode decrypts with the private key

func (*OpenPGP) Encode

func (o *OpenPGP) Encode(r io.Reader, w io.Writer) error

Encode encrypts a stream with the public key.

func (*OpenPGP) Start

func (o *OpenPGP) Start() error

Start reads the keys and decrypt the private key if a PassPhrase is set.

Jump to

Keyboard shortcuts

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