jws

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSignature

func GenerateSignature(jwsHeader *JwsHeader, httpHeaders map[string]string, privateKey *rsa.PrivateKey) (string, error)

Types

type JwsHeader

type JwsHeader struct {
	B64  bool          `json:"b64"`
	S256 string        `json:"x5t#S256"`
	Crit []string      `json:"crit"`
	SigT string        `json:"sigT"`
	SigD SignedHeaders `json:"sigD"`
	Alg  string        `json:"alg"`
}

func DefaultJwsHeader

func DefaultJwsHeader() *JwsHeader

func (*JwsHeader) WithB64

func (jh *JwsHeader) WithB64(b64 bool) *JwsHeader

func (*JwsHeader) WithCertificate

func (jh *JwsHeader) WithCertificate(certificate x509.Certificate) *JwsHeader

func (*JwsHeader) WithClaimedTime

func (jh *JwsHeader) WithClaimedTime(claimedTime time.Time) *JwsHeader

func (*JwsHeader) WithCrit

func (jh *JwsHeader) WithCrit(criticalFields []string) *JwsHeader

func (*JwsHeader) WithSignedHeaders

func (jh *JwsHeader) WithSignedHeaders(headers []string) *JwsHeader

func (*JwsHeader) WithSigningAlgorithm

func (jh *JwsHeader) WithSigningAlgorithm(algorithm string) *JwsHeader

type SignedHeaders

type SignedHeaders struct {
	Pars []string `json:"pars"`
	MId  string   `json:"mId"`
}

Jump to

Keyboard shortcuts

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