keymanager

package
v4.0.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyPair

type KeyPair struct {
	// unique identifier for the key
	ID      uuid.UUID
	Private *rsa.PrivateKey
	Public  *rsa.PublicKey
	// PKIX, ASN.1 DER converted public key
	Der []byte
}

KeyPair is the set of RSA keys held by the lock manager.

type Manager

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

Manager is responsible for generating an RSA key pair, persisting it to storage, and periodically updating its key pair expiration.

Clients may use a manager to retrieve the currently managed KeyPair for signing.

A Manager should always be constructed via the NewManager constructor.

func NewManager

func NewManager(ctx context.Context, store notifier.KeyStore) (*Manager, error)

NewMananger will return a Mananger with a managed key pair.

Clients may query the manager to retrieve the currently managed key pair.

If the manager fails to create and persist a key pair construction will fail.

Ensure cancelation of ctx to avoid go routine leakage.

func (*Manager) KeyPair

func (m *Manager) KeyPair() (KeyPair, error)

KeyPair returns the currently managed key pair.

An error is returned if no key pair exists.

Jump to

Keyboard shortcuts

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