key

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2016 License: Apache-2.0, Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNoKeys = errors.New("no keys found")
View Source
var (
	ErrorPrivateKeysExpired = errors.New("private keys have expired")
)

Functions

Types

type GeneratePrivateKeyFunc

type GeneratePrivateKeyFunc func() (*PrivateKey, error)

type KeySet

type KeySet interface {
	ExpiresAt() time.Time
}

type KeySetSyncer

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

func (*KeySetSyncer) Run

func (s *KeySetSyncer) Run() chan struct{}

type PrivateKey

type PrivateKey struct {
	KeyID      string
	PrivateKey *rsa.PrivateKey
}

func GeneratePrivateKey

func GeneratePrivateKey() (*PrivateKey, error)

func (*PrivateKey) ID

func (k *PrivateKey) ID() string

func (*PrivateKey) JWK

func (k *PrivateKey) JWK() jose.JWK

func (*PrivateKey) Signer

func (k *PrivateKey) Signer() jose.Signer

type PrivateKeyManager

type PrivateKeyManager interface {
	ExpiresAt() time.Time
	Signer() (jose.Signer, error)
	JWKs() ([]jose.JWK, error)
	PublicKeys() ([]PublicKey, error)

	WritableKeySetRepo
	health.Checkable
}

func NewPrivateKeyManager

func NewPrivateKeyManager() PrivateKeyManager

type PrivateKeyRotator

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

func NewPrivateKeyRotator

func NewPrivateKeyRotator(repo PrivateKeySetRepo, ttl time.Duration) *PrivateKeyRotator

func (*PrivateKeyRotator) Healthy

func (r *PrivateKeyRotator) Healthy() error

func (*PrivateKeyRotator) Run

func (r *PrivateKeyRotator) Run() chan struct{}

type PrivateKeySet

type PrivateKeySet struct {
	ActiveKeyID string
	// contains filtered or unexported fields
}

func NewPrivateKeySet

func NewPrivateKeySet(keys []*PrivateKey, exp time.Time) *PrivateKeySet

func (*PrivateKeySet) Active

func (s *PrivateKeySet) Active() *PrivateKey

func (*PrivateKeySet) ExpiresAt

func (s *PrivateKeySet) ExpiresAt() time.Time

func (*PrivateKeySet) Keys

func (s *PrivateKeySet) Keys() []*PrivateKey

type PrivateKeySetRepo

type PrivateKeySetRepo interface {
	WritableKeySetRepo
	ReadableKeySetRepo
}

func NewPrivateKeySetRepo

func NewPrivateKeySetRepo() PrivateKeySetRepo

type PublicKey

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

func NewPublicKey

func NewPublicKey(jwk jose.JWK) *PublicKey

func (*PublicKey) ID

func (k *PublicKey) ID() string

func (*PublicKey) MarshalJSON added in v1.2.0

func (k *PublicKey) MarshalJSON() ([]byte, error)

func (*PublicKey) UnmarshalJSON added in v1.2.0

func (k *PublicKey) UnmarshalJSON(data []byte) error

func (*PublicKey) Verifier

func (k *PublicKey) Verifier() (jose.Verifier, error)

type PublicKeySet

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

func NewPublicKeySet

func NewPublicKeySet(jwks []jose.JWK, exp time.Time) *PublicKeySet

func (*PublicKeySet) ExpiresAt

func (s *PublicKeySet) ExpiresAt() time.Time

func (*PublicKeySet) Key

func (s *PublicKeySet) Key(id string) *PublicKey

func (*PublicKeySet) Keys

func (s *PublicKeySet) Keys() []PublicKey

type ReadableKeySetRepo

type ReadableKeySetRepo interface {
	Get() (KeySet, error)
}

type WritableKeySetRepo

type WritableKeySetRepo interface {
	Set(KeySet) error
}

Jump to

Keyboard shortcuts

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