client

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MPL-2.0 Imports: 8 Imported by: 5

Documentation

Overview

Package client provides utilities for handling client-side PGP keys.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	*pgp.Key
	// contains filtered or unexported fields
}

Key represents an OpenPGP client key pair associated with a context and an identity. It is stored on the filesystem.

type KeyProvider

type KeyProvider struct {
	// contains filtered or unexported fields
}

KeyProvider handles loading/saving client keys.

func NewKeyProvider

func NewKeyProvider(dataFileDirectory string) *KeyProvider

NewKeyProvider creates a new KeyProvider.

func (*KeyProvider) DeleteKey

func (provider *KeyProvider) DeleteKey(context, email string) error

DeleteKey deletes the key pair from disk.

func (*KeyProvider) GenerateKey

func (provider *KeyProvider) GenerateKey(context, email, clientNameWithVersion string) (*Key, error)

GenerateKey generates a new PGP key pair.

func (*KeyProvider) ReadValidKey

func (provider *KeyProvider) ReadValidKey(context, email string) (*Key, error)

ReadValidKey reads a PGP key from the filesystem.

If the key is missing or invalid (e.g., expired, revoked), an error will be returned.

func (*KeyProvider) WriteKey

func (provider *KeyProvider) WriteKey(c *Key) (string, error)

WriteKey saves the key pair to disk and returns the save path.

Jump to

Keyboard shortcuts

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