storage

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

The backend package contains the various options for storing the actual private keys. Currently only a file backend is supported

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("entry not found")

ErrNotFound indicates that the specified crypto storage entry couldn't be found.

Functions

func NewFileSystemBackend

func NewFileSystemBackend(fspath string) (*fileSystemBackend, error)

Create a new filesystem backend, all directories will be created for the given path Using a filesystem backend in production is not recommended!

Types

type FileOpenError

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

func (*FileOpenError) Error

func (f *FileOpenError) Error() string

Error returns the string representation

func (*FileOpenError) Unwrap

func (f *FileOpenError) Unwrap() error

UnWrap is needed for FileOpenError to be UnWrapped

type Storage

type Storage interface {
	GetPrivateKey(key types.KeyIdentifier) (*rsa.PrivateKey, error)
	GetPublicKey(key types.KeyIdentifier) (*rsa.PublicKey, error)
	PrivateKeyExists(key types.KeyIdentifier) bool
	SavePrivateKey(keyIdentifier types.KeyIdentifier, key *rsa.PrivateKey) error
	SaveCertificate(key types.KeyIdentifier, certificate []byte) error
	GetCertificate(key types.KeyIdentifier) (*x509.Certificate, error)
	CertificateExists(key types.KeyIdentifier) bool
}

Storage interface containing functions for storing and retrieving keys

Jump to

Keyboard shortcuts

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