keystore

package
v0.0.0-...-02c76fb Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keystore

type Keystore struct {
	LocalPath  string
	UserPath   string
	SystemPath string
	// contains filtered or unexported fields
}

A Keystore represents a repository of trusted public keys which can be used to verify PGP signatures.

func Default

func Default() *Keystore

Default returns a keystore backed by the default local, user, and system paths.

func New

func New(localPath, userPath, systemPath string) *Keystore

New returns a new Keystore backed by the provided paths.

func (*Keystore) CheckSignature

func (ks *Keystore) CheckSignature(signed, signature io.Reader) error

CheckSignature takes a signed file and a detached signature and verifies if it is signed by a trusted signer.

func (*Keystore) DeleteTrustedKey

func (ks *Keystore) DeleteTrustedKey(fingerprint string) error

DeleteTrustedKey deletes the trusted key identified by fingerprint.

func (*Keystore) MaskTrustedSystemKey

func (ks *Keystore) MaskTrustedSystemKey(fingerprint string) (string, error)

MaskTrustedSystemKey masks the system trusted key identified by fingerprint.

func (*Keystore) StoreTrustedKey

func (ks *Keystore) StoreTrustedKey(pubkeyBytes []byte) (string, error)

StoreTrustedKey stores the contents of the public key.

Jump to

Keyboard shortcuts

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