jwx

package module
v0.0.0-...-35ffbac Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonWebAlgorithm

type JsonWebAlgorithm interface {
	Verify(key *JsonWebKey, input, sig []byte) error
	Sign(key *JsonWebKey, input []byte) ([]byte, error)
}

type JsonWebKey

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

func (*JsonWebKey) UnmarshalJSON

func (k *JsonWebKey) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON reads a key from its JSON representation.

type JsonWebKeySet

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

func ParseJWKSBytes

func ParseJWKSBytes(jwkSet []byte) (res *JsonWebKeySet, err error)

type JsonWebSignature

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

JsonWebSignature follows structure defined in full jws serialization defined in rfc7515#section-7.2.1

func NewJsonWebSignature

func NewJsonWebSignature(payload []byte) *JsonWebSignature

func (*JsonWebSignature) ParseCompact

func (s *JsonWebSignature) ParseCompact(jws string) error

ParseCompact parses a compact serialized token defined in rfc7515#section-7.1

func (*JsonWebSignature) ParseJSONFlattened

func (s *JsonWebSignature) ParseJSONFlattened(jws string) error

ParseJSONFlattened parses a json serialized token defined in rfc7515#section-7.2.2

func (*JsonWebSignature) ParseJSONGeneral

func (s *JsonWebSignature) ParseJSONGeneral(jws string) error

ParseJSONGeneral parses a json serialized token defined in rfc7515#section-7.2.1

func (*JsonWebSignature) Payload

func (s *JsonWebSignature) Payload() []byte

func (*JsonWebSignature) Sign

func (s *JsonWebSignature) Sign(header map[string]string, key *JsonWebKey) error

func (*JsonWebSignature) Signed

func (s *JsonWebSignature) Signed() bool

func (*JsonWebSignature) VerifyKeySet

func (s *JsonWebSignature) VerifyKeySet(jwks *JsonWebKeySet) error

func (*JsonWebSignature) VerifyKeySingle

func (s *JsonWebSignature) VerifyKeySingle(jwk *JsonWebKey) error

type JsonWebToken

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

func (*JsonWebToken) Header

func (t *JsonWebToken) Header(k string) *jsontk.JSON

func (*JsonWebToken) Parse

func (t *JsonWebToken) Parse(tk string) (err error)

func (*JsonWebToken) VerifyKeySet

func (t *JsonWebToken) VerifyKeySet(k *JsonWebKeySet) error

Jump to

Keyboard shortcuts

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