keys

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedKeyManager

type CachedKeyManager struct {
	Endpoint *url.URL
	Client   *http.Client
	// contains filtered or unexported fields
}

CachedKeyManager uses hydra rest api to retrieve keys and cache them for easy access

func NewCachedKeyManager

func NewCachedKeyManager(id, secret, cluster string) (*CachedKeyManager, error)

NewCachedKeyManager returns a CachedKeyManager connected to the hydra cluster it can fail if the cluster is not a valid url, or if the id and secret don't work

func (CachedKeyManager) GetRSAPrivate

func (m CachedKeyManager) GetRSAPrivate(set string) (*rsa.PrivateKey, error)

GetRSAPrivate retrieves the first key of the given set. It caches them forever, so hope that they don't change

func (CachedKeyManager) GetRSAPublic

func (m CachedKeyManager) GetRSAPublic(set string) (*rsa.PublicKey, error)

GetRSAPublic retrieves the first key of the given set. It caches them forever, so hope that they don't change

type KeyGetter

type KeyGetter interface {
	GetRSAPublic(set string) (*rsa.PublicKey, error)
	GetRSAPrivate(set string) (*rsa.PrivateKey, error)
}

KeyGetter provides functions to retrieve a key from an hydra set (tipically the first)

Jump to

Keyboard shortcuts

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