jwk

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonWebKey

type JsonWebKey struct {
	ID              string                       `json:"kid"`
	Algorithm       encryption.EncryptionKey     `json:"alg"`
	AlgorithmFamily encryption.EncryptionKeyType `json:"kty"`
	Use             string                       `json:"use"`
	X5C             []string                     `json:"x5c"`
	Exponent        string                       `json:"e,omitempty"`
	Modulus         string                       `json:"n,omitempty"`
	Curve           string                       `json:"curve,omitempty"`
	X               string                       `json:"x,omitempty"`
	Y               string                       `json:"y,omitempty"`
	Thumbprint      string                       `json:"x5t"`
}

func Decode

func Decode(jwk string) (*JsonWebKey, error)

func NewKey

func NewKey(privateKey interface{}) *JsonWebKey

func NewKeyWithId

func NewKeyWithId(id string, privateKey interface{}) *JsonWebKey

func (JsonWebKey) GetKey

func (k JsonWebKey) GetKey() interface{}

func (JsonWebKey) GetPublicKeyAt

func (k JsonWebKey) GetPublicKeyAt(index int) interface{}

func (JsonWebKey) Validate

func (k JsonWebKey) Validate(key interface{}) bool

type JsonWebKeys

type JsonWebKeys struct {
	Keys []*JsonWebKey `json:"keys"`
}

func New

func New() *JsonWebKeys

func (*JsonWebKeys) Add

func (jk *JsonWebKeys) Add(id string, privateKey interface{})

Jump to

Keyboard shortcuts

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