Documentation ¶
Index ¶
- Variables
- func Sync(r ReadableKeySetRepo, w WritableKeySetRepo) (time.Duration, error)
- type GeneratePrivateKeyFunc
- type KeySet
- type KeySetSyncer
- type PrivateKey
- type PrivateKeyManager
- type PrivateKeyRotator
- type PrivateKeySet
- type PrivateKeySetRepo
- type PublicKey
- type PublicKeySet
- type ReadableKeySetRepo
- type WritableKeySetRepo
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 ¶
func Sync ¶
func Sync(r ReadableKeySetRepo, w WritableKeySetRepo) (time.Duration, error)
Types ¶
type GeneratePrivateKeyFunc ¶
type GeneratePrivateKeyFunc func() (*PrivateKey, error)
type KeySetSyncer ¶
type KeySetSyncer struct {
// contains filtered or unexported fields
}
func NewKeySetSyncer ¶
func NewKeySetSyncer(r ReadableKeySetRepo, w WritableKeySetRepo) *KeySetSyncer
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 (*PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
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 WritableKeySetRepo ¶
Click to show internal directories.
Click to hide internal directories.