pgp

package
v0.0.0-...-7a7f204 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SksParsedFullFileName = "sks-full.pgp"
	SksOriginalFolder     = "sks-original"
	SksParsedFolder       = "sks"
)

Variables

This section is empty.

Functions

func AnalyzeKeyDump

func AnalyzeKeyDump(files []string) (map[string]*openpgp.Entity, error)

func ArmorKey

func ArmorKey(entity *openpgp.Entity) (string, error)

func GetAllFiles

func GetAllFiles(dir string) ([]string, error)

GetAllFiles returns all the filenames from the directory

func GetFilesThatMatch

func GetFilesThatMatch(dir string, rgx string) ([]string, error)

GetFilesThatMatch returns the filenames from the directory which match with the given regex expression

func GetSksOriginalDumpFiles

func GetSksOriginalDumpFiles(dir string) ([]string, error)

Reads the given directory and returns the file names matching the sks dump description

func LoadAndParseKeys

func LoadAndParseKeys(files []string) ([]*openpgp.Entity, error)

func PrimaryEmail

func PrimaryEmail(e *openpgp.Entity) string

Returns the lower-cased email from the primary identity, or if it is empty, the alphabetically first non-empty lower-cased email

func RecoverKeyFromBlock

func RecoverKeyFromBlock(block []byte, email string) (*openpgp.Entity, error)

Returns an Entity with the given email in the primary ID from a block of serialized entities.

func WriteKeysOnDisk

func WriteKeysOnDisk(dir string, entities map[string]*openpgp.Entity) error

Types

type Key

type Key struct {
	ID     string
	Packet []byte
}

Key defines a PGP item after processing and saving into a binary file

func LoadKeysFromDisk

func LoadKeysFromDisk(files []string) ([]*Key, error)

Jump to

Keyboard shortcuts

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