key

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 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 Key

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

func New

func New(config *config.Config) *Key

New returns a new instance of key with private and public key If the configuration requires a new set of keys generated, it will generate them accordingly

func (*Key) PrivateKey

func (k *Key) PrivateKey() (*rsa.PrivateKey, error)

PrivateKey returns a private key object from the configured path

func (*Key) PublicKey

func (k *Key) PublicKey() (*rsa.PublicKey, error)

PublicKey returns a public key object from the configured path

func (*Key) Signer

func (k *Key) Signer(headers map[string]string, algorithm jose.SignatureAlgorithm, signerType SignerType) (jose.Signer, error)

Signer returns a preferred method of signing token based on the algorithm and type provided

type SignerType

type SignerType int
const (
	JWT SignerType = iota
	JWE
)

func (SignerType) String

func (s SignerType) String() jose.ContentType

Jump to

Keyboard shortcuts

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