keystores

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package keystores contains logic for loading encryption keys from a keystores

Index

Constants

View Source
const LocalKeyStore = "local"

LocalKeyStore is the config value for an on-disk key store

Variables

View Source
var ErrUnknownKeyID = errors.New("unknown key id")

ErrUnknownKeyID is returned when the Key ID cannot be found by the keystore.

Functions

This section is empty.

Types

type KeyStore

type KeyStore interface {
	// GetKey retrieves the key for the specified algorithm by key ID.
	GetKey(id string) ([]byte, error)
}

KeyStore represents a struct which stores or can fetch encryption keys.

func NewKeyStoreFromConfig

func NewKeyStoreFromConfig(config serverconfig.CryptoConfig) (KeyStore, error)

NewKeyStoreFromConfig creates an instance of a KeyStore based on the AuthConfig in Minder. Since our only implementation is based on reading from the local disk, do all key loading during construction of the struct.

func NewKeyStoreFromMap

func NewKeyStoreFromMap(keys keysByID, fallbackID string) KeyStore

NewKeyStoreFromMap constructs a keystore from a map of key ID to key bytes. This is mostly useful for testing.

Directories

Path Synopsis
Package mock_keystores is a generated GoMock package.
Package mock_keystores is a generated GoMock package.

Jump to

Keyboard shortcuts

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