keystore

package
v0.0.0-...-eb12069 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPassword = errors.New("invalid password")

ErrInvalidPassword is returned when the password for decrypting content where private key is stored is not valid.

Functions

This section is empty.

Types

type EDG

type EDG interface {
	Generate() (*ecdsa.PrivateKey, error)
	Encode(k *ecdsa.PrivateKey) ([]byte, error)
	Decode(data []byte) (*ecdsa.PrivateKey, error)
}

EDG represents and encoder/decoder/generator for ECDSA private keys

type Service

type Service interface {
	// Key returns the private key for a specified name that was encrypted with
	// the provided password. If the private key does not exists it creates
	// a new one with a name and the password, and returns with created set
	// to true.
	Key(name, password string, edg EDG) (pk *ecdsa.PrivateKey, created bool, err error)
	// Exists returns true if the key with specified name exists.
	Exists(name string) (bool, error)
	// SetKey generates and persists a new private key
	SetKey(name, password string, edg EDG) (*ecdsa.PrivateKey, error)
}

Service for managing keystore private keys.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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