jws

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwsHeader

type JwsHeader struct {
	Alg       string `json:"alg"`           // algorithm, should be "ES512".
	Kid       string `json:"kid"`           // signing key id.
	TlVersion string `json:"tl_version"`    // signing scheme version, e.g. "2", empty implies v1 aka body-only signing.
	TlHeaders string `json:"tl_headers"`    // comma separated ordered headers used in the signature.
	Jku       string `json:"jku,omitempty"` // Json Web Key Url. Used in webhook signatures providing the public key jwk url.
}

Tl-Signature header.

func NewJwsHeaderV2

func NewJwsHeaderV2(kid string, headers *orderedmap.OrderedMap, jku string) JwsHeader

func (*JwsHeader) FilterHeaders

func (j *JwsHeader) FilterHeaders(headers map[string][]byte) (*orderedmap.OrderedMap, error)

FilterHeaders filters & orders headers to match jws header "tl_headers".

Returns an error if "headers" is missing any of the declared "tl_headers".

Jump to

Keyboard shortcuts

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