encryption

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeJSONFromReader

func DecodeJSONFromReader(r io.Reader, out interface{}) error

Decodes/Unmarshals the given io.Reader pointing to a JSON, into a desired object

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 EncryptValue

func EncryptValue(encryptionKey, value, description string) (string, string, error)

EncryptValue encrypts the given value with the given encryption key. Description should be set such that errors return a meaningful user-facing response.

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.

func RetrieveGPGKey

func RetrieveGPGKey(pgpKey string) (string, error)

RetrieveGPGKey returns the PGP key specified as the pgpKey parameter, or queries the public key from the keybase service if the parameter is a keybase username prefixed with the phrase "keybase:"

Types

This section is empty.

Jump to

Keyboard shortcuts

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