keystore

package
v0.0.0-...-2e936b0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKidLookup = errors.New("kid lookup failed")
)

Error variables for key store.

Functions

This section is empty.

Types

type Memory

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

Memory represents an in memory store implementation of the KeyLookup interface for use with the auth package.

func NewMemory

func NewMemory() *Memory

NewMemory constructs an empty key store.

func NewMemoryFS

func NewMemoryFS(fsys fs.FS) (*Memory, error)

NewMemoryFS constructs a key store and fill it with keys from fs.

func NewMemoryStore

func NewMemoryStore(store map[string]PrivateKey) *Memory

NewMemoryStore constructs a key store with an initial set of keys.

func (*Memory) PrivateKeyPEM

func (ks *Memory) PrivateKeyPEM(kid string) (string, error)

PrivateKeyPEM searches the key store for a given kid and returns the private key.

func (*Memory) PublicKeyPEM

func (ks *Memory) PublicKeyPEM(kid string) (string, error)

PublicKeyPEM searches the key store for a given kid and returns the public key.

type PrivateKey

type PrivateKey struct {
	PK  *rsa.PrivateKey
	PEM []byte
}

PrivateKey represents key information.

Jump to

Keyboard shortcuts

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