openpgp

package
v0.0.6-dev Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: MIT Imports: 13 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 interface {
	GetPublicKey() string
	AddPublicKey(armored []byte) error
	AddPrivateKey(armored []byte) error
	GeneratePair() error
	ReloadPublicKeys(keys []string) error
	ReadFolder(name string) error
	EncryptWithKeys(data []byte) ([]byte, error)
	DecryptWithKeys(data []byte) ([]byte, error)
}

func New

func New() (OPENPGP, error)

New() - pgp initialization

type OpenPGP

type OpenPGP struct {
	Public  *pgpcrypto.KeyRing // public keyring
	Private *pgpcrypto.KeyRing // private keyring
	// contains filtered or unexported fields
}

OpenPGP - openpgp endpoint struct

func (*OpenPGP) AddPrivateKey

func (p *OpenPGP) AddPrivateKey(armored []byte) error

AddPrivateKey - add private key to keyring

func (*OpenPGP) AddPublicKey

func (p *OpenPGP) AddPublicKey(armored []byte) error

AddPublicKey - add new public key to keyring

func (*OpenPGP) DecryptWithKeys

func (p *OpenPGP) DecryptWithKeys(data []byte) ([]byte, error)

DecryptWithKey - decrypt data with PC's private key

func (*OpenPGP) EncryptWithKeys

func (p *OpenPGP) EncryptWithKeys(data []byte) ([]byte, error)

EncryptWithKeys - encrypt data with public keyring

func (*OpenPGP) GeneratePair

func (p *OpenPGP) GeneratePair() error

GeneratePair - generate key pair for current PC. name is machine-id

func (*OpenPGP) GetPublicKey

func (p *OpenPGP) GetPublicKey() string

GetPublicKey - retrun runnig public key

func (*OpenPGP) ReadFolder

func (p *OpenPGP) ReadFolder(name string) error

ReadFolder - read PC keys from openpgp folder

func (*OpenPGP) ReloadPublicKeys

func (p *OpenPGP) ReloadPublicKeys(keys []string) error

ReloadPublicKeys - reload public key ring with keys hashsums

Directories

Path Synopsis
Package mock_openpgp is a generated GoMock package.
Package mock_openpgp is a generated GoMock package.

Jump to

Keyboard shortcuts

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