jwx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToJWKS

func KeyToJWKS(publicKey interface{}, alg jwa.SignatureAlgorithm) jwk.Set

KeyToJWKS creates a jwk.Set from the passed publicKey and sets the algorithm key in the jwk.Key to the passed jwa.SignatureAlgorithm

func SignEntityStatement

func SignEntityStatement(payload []byte, signingAlg jwa.SignatureAlgorithm, key crypto.Signer) ([]byte, error)

SignEntityStatement creates a signed JWT of the 'entity-statement+jwt' type for the passed payload using the passed crypto.Signer with the passed jwa.SignatureAlgorithm

func SignPayload

func SignPayload(payload []byte, signingAlg jwa.SignatureAlgorithm, key crypto.Signer, headers jws.Headers) (
	[]byte,
	error,
)

SignPayload signs a payload with the passed properties and adds the kid to the jwt header

func VerifyWithSet

func VerifyWithSet(msg *jws.Message, keys jwk.Set) ([]byte, error)

VerifyWithSet uses a jwk.Set to verify a *jws.Message, returning the decoded payload or an error

Types

This section is empty.

Jump to

Keyboard shortcuts

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