keymagic

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const MinKeyBits = 2048 // Should be safe until we have decent Quantum Computers

Variables

This section is empty.

Functions

func GetSKSKey

func GetSKSKey(fingerPrint string) (string, error)

func MakePGPManager

MakePGPManager creates a new PGPManager with the specified keyBackend, log and KeyRingManager

func MakeSecretsManager

func MakeSecretsManager(log slog.Instance, dbHandler DatabaseHandler) interfaces.SecretsManager

MakeSecretsManager creates an instance of the backend secrets manager

func PKSAdd

func PKSAdd(ctx context.Context, pubKey string) string

func PKSGetKey

func PKSGetKey(ctx context.Context, fingerPrint string) (string, error)

func PKSSearch

func PKSSearch(ctx context.Context, value string, pageStart, pageEnd int) ([]models.GPGKey, error)

func PKSSearchByEmail

func PKSSearchByEmail(ctx context.Context, email string, pageStart, pageEnd int) ([]models.GPGKey, error)

func PKSSearchByFingerPrint

func PKSSearchByFingerPrint(ctx context.Context, fingerPrint string, pageStart, pageEnd int) ([]models.GPGKey, error)

func PKSSearchByName

func PKSSearchByName(ctx context.Context, name string, pageStart, pageEnd int) ([]models.GPGKey, error)

func PutSKSKey

func PutSKSKey(publicKey string) (bool, error)

Types

type DatabaseHandler added in v1.4.0

type DatabaseHandler interface {
	AddGPGKey(key models.GPGKey) (string, bool, error)
	FindGPGKeyByEmail(email string, pageStart, pageEnd int) ([]models.GPGKey, error)
	FindGPGKeyByFingerPrint(fingerPrint string, pageStart, pageEnd int) ([]models.GPGKey, error)
	FindGPGKeyByValue(value string, pageStart, pageEnd int) ([]models.GPGKey, error)
	FindGPGKeyByName(name string, pageStart, pageEnd int) ([]models.GPGKey, error)
	FetchGPGKeyByFingerprint(fingerprint string) (*models.GPGKey, error)
}

type KeyRingManager

type KeyRingManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func MakeKeyRingManager

func MakeKeyRingManager(log slog.Instance, dbHandler DatabaseHandler) *KeyRingManager

MakeKeyRingManager creates a new instance of KeyRingManager

func (*KeyRingManager) AddKey

func (krm *KeyRingManager) AddKey(ctx context.Context, key *openpgp.Entity, nonErasable bool)

func (*KeyRingManager) ContainsKey

func (krm *KeyRingManager) ContainsKey(ctx context.Context, fp string) bool

func (*KeyRingManager) DeleteKey

func (krm *KeyRingManager) DeleteKey(ctx context.Context, fp string) error

func (*KeyRingManager) GetCachedKeys

func (krm *KeyRingManager) GetCachedKeys(ctx context.Context) []models.KeyInfo

func (*KeyRingManager) GetFingerPrints

func (krm *KeyRingManager) GetFingerPrints(ctx context.Context) []string

func (*KeyRingManager) GetKey

func (krm *KeyRingManager) GetKey(ctx context.Context, fp string) *openpgp.Entity

Jump to

Keyboard shortcuts

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