Documentation ¶
Overview ¶
Package keystore implements the auth.KeyStore interface. This implements an in-memory keystore for JWT support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore represents an in memory store implementation of the KeyStorer interface for use with the auth package.
func NewFS ¶
NewFS constructs a KeyStore based on a set of PEM files rooted inside of a directory. The name of each PEM file will be used as the key id. Example: keystore.NewFS(os.DirFS("/zarf/keys/")) Example: /zarf/keys/54bb2165-71e1-41a6-af3e-7da4a0e1e2c1.pem
func NewMap ¶
func NewMap(store map[string]*rsa.PrivateKey) *KeyStore
NewMap constructs a KeyStore with an initial set of keys.
func (*KeyStore) Add ¶
func (ks *KeyStore) Add(privateKey *rsa.PrivateKey, kid string)
Add adds a private key and combination kid to the store.
func (*KeyStore) PrivateKey ¶
func (ks *KeyStore) PrivateKey(kid string) (*rsa.PrivateKey, error)
PrivateKey searches the key store for a given kid and returns the private key.