pgp

package
v0.0.0-...-9e7e4f5 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: MPL-2.0 Imports: 13 Imported by: 2

Documentation

Overview

The PGP package is a helper around Golang's OpenPGP implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmorPubKey

func ArmorPubKey(pubkey []byte) (armoredPubKey []byte, err error)

func ArmoredKeysToKeyring

func ArmoredKeysToKeyring(keys [][]byte) (keyring io.ReadSeeker, keycount int, err error)

ArmoredKeysToKeyring takes a list of PGP keys in armored form and transforms it into a keyring that can be used in other openpgp's functions

func CachePassphrase

func CachePassphrase(s string)

CachePassphrase() can be used to pre-cache a passphrase and avoid asking for it. This would normally be called from the MIG client API.

func GenerateKeyPair

func GenerateKeyPair(name, desc, email string) (pubkey, privkey []byte, fp string, err error)

func GetArmoredKeyFromKeyServer

func GetArmoredKeyFromKeyServer(keyid, keyserver string) (key []byte, err error)

func GetFingerprintFromSignature

func GetFingerprintFromSignature(data string, signature string, keyring io.Reader) (fingerprint string, err error)

func KeyringToArmoredPubKeys

func KeyringToArmoredPubKeys(keyring io.ReadCloser) (armoredkeys map[string][]byte, err error)

KeyringToArmoredPubKeys reads all public keys from a keyring and returned their armored format into map of keys indexed by key fingerprint

func LoadArmoredPubKey

func LoadArmoredPubKey(pubkey []byte) (pgpfingerprint string, err error)

LoadArmoredPubKey takes a single public key as a byte slice, validates it, and returns its its fingerprint or an error

func Sign

func Sign(data, keyid string, secringFile io.Reader) (sig string, err error)

Sign signs a string with a key identified by a key fingerprint or an email address

func Verify

func Verify(data string, signature string, keyring io.Reader) (valid bool, entity *openpgp.Entity, err error)

Verify() checks the validity of a signature for some data, and returns a boolean set to true if valid and an OpenPGP Entity

Types

This section is empty.

Directories

Path Synopsis
Package gpgagent interacts with the local GPG Agent.
Package gpgagent interacts with the local GPG Agent.
Package pinentry interfaces with the pinentry(1) command to securely prompt the user for a password using whichever user interface the user is currently using.
Package pinentry interfaces with the pinentry(1) command to securely prompt the user for a password using whichever user interface the user is currently using.

Jump to

Keyboard shortcuts

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