service

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package service contains services used by code here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateGenerator

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

CertificateGenerator is used to generate certificates.

func NewCertificateGenerator

func NewCertificateGenerator(lifeTime time.Duration) *CertificateGenerator

NewCertificateGenerator is the preferred way to instantiate a certificate generator.

func (*CertificateGenerator) CreateChild

func (c *CertificateGenerator) CreateChild(parent *x509.Certificate, key interface{}) (*x509.Certificate, error)

CreateChild - creates a child certificate with given key and parent certificate.

func (*CertificateGenerator) CreateParent

func (c *CertificateGenerator) CreateParent() (*x509.Certificate, error)

CreateParent generates a X.509 parent/root certificate for use in authorization servers.

type ClientRepo added in v1.1.1

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

ClientRepo is a repo for storing registred clients and generating tokens for clients.

func NewClientRepo added in v1.1.1

func NewClientRepo() *ClientRepo

NewClientRepo is the preferred way to instantiate a client repo.

func (*ClientRepo) GenerateToken added in v1.1.1

GenerateToken generates a token response from the given client request

func (*ClientRepo) Register added in v1.1.1

func (c *ClientRepo) Register(registration jwtmock.ClientRegistration) error

Register registers a new client and returns any errors

type KeyStore

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

KeyStore is used to keep state about current JWKS and signing key.

func NewKeyStore

func NewKeyStore(generator *jwks.Generator) (*KeyStore, error)

NewKeyStore is the preferred way to instantiate a key store.

func (*KeyStore) GenerateNew

func (k *KeyStore) GenerateNew() error

GenerateNew generates a new pair of JWKS and signing key.

func (*KeyStore) GetJWKS

func (k *KeyStore) GetJWKS() *jwk.Set

GetJWKS returns the currently stored JWKS.

func (*KeyStore) GetSigningKey

func (k *KeyStore) GetSigningKey() *jwtmock.SigningKey

GetSigningKey returns the currently stored signing key.

type RSAKeyGenerator

type RSAKeyGenerator struct{}

RSAKeyGenerator generates key IDs and keys.

func NewRSAKeyGenerator

func NewRSAKeyGenerator() *RSAKeyGenerator

NewRSAKeyGenerator is the preferred way to create a RSA key generator.

func (*RSAKeyGenerator) GenerateKey

func (k *RSAKeyGenerator) GenerateKey(length int) (*jwtmock.SigningKey, error)

GenerateKey generates a RSA signing key.

Jump to

Keyboard shortcuts

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