pgpkeys

package
v1.65.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptBytes

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

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

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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