pgpkeys

package
v0.6.0-beta1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2016 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestPrivKey1 = `` /* 3724-byte string literal not displayed */

	TestPrivKey2 = `` /* 3724-byte string literal not displayed */

	TestPrivKey3 = `` /* 3724-byte string literal not displayed */

	TestPubKey1 = `` /* 1965-byte string literal not displayed */

	TestPubKey2 = `` /* 1965-byte string literal not displayed */

	TestPubKey3 = `` /* 1965-byte string literal not displayed */

	TestAAPubKey1 = `` /* 2067-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func DecryptBytes added in v0.5.0

func DecryptBytes(encodedCrypt, privKey string) (*bytes.Buffer, error)

DecryptBytes takes in base64-encoded encrypted bytes and the base64-encoded private key and decrypts it. A bytes.Buffer is returned to allow the caller to do useful thing with it (get it as a []byte, get it as a string, use it as an io.Reader, etc), and also because this function doesn't know if what comes out is binary data or a string, so let the caller decide.

func EncryptShares

func EncryptShares(input [][]byte, pgpKeys []string) ([]string, [][]byte, error)

EncryptShares takes an ordered set of byte slices to encrypt and the corresponding base64-encoded public keys to encrypt them with, encrypts each byte slice with the corresponding public key.

Note: There is no corresponding test function; this functionality is thoroughly tested in the init and rekey command unit tests

func FetchKeybasePubkeys added in v0.5.0

func FetchKeybasePubkeys(input []string) (map[string]string, error)

FetchKeybasePubkeys fetches public keys from Keybase given a set of usernames, which are derived from correctly formatted input entries. It doesn't use their client code due to both the API and the fact that it is considered alpha and probably best not to rely on it. The keys are returned as base64-encoded strings.

func GetEntities added in v0.5.0

func GetEntities(pgpKeys []string) ([]*openpgp.Entity, error)

GetEntities takes in a string array of base64-encoded PGP keys and returns the openpgp Entities

func GetFingerprints added in v0.5.0

func GetFingerprints(pgpKeys []string, entities []*openpgp.Entity) ([]string, error)

GetFingerprints takes in a list of openpgp Entities and returns the fingerprints. If entities is nil, it will instead parse both entities and fingerprints from the pgpKeys string slice.

func ReadPGPFile added in v0.5.0

func ReadPGPFile(path string) (string, error)

Types

type PubKeyFilesFlag

type PubKeyFilesFlag []string

PGPPubKeyFiles implements the flag.Value interface and allows parsing and reading a list of pgp public key files

func (*PubKeyFilesFlag) Set

func (p *PubKeyFilesFlag) Set(value string) error

func (*PubKeyFilesFlag) String

func (p *PubKeyFilesFlag) String() string

Jump to

Keyboard shortcuts

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