clientinstance

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

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

Client Instance Claims, referred also as "cic" in the OpenPubKey paper

func NewClaims

func NewClaims(publicKey jwk.Key, claims map[string]any) (*Claims, error)

Client instance claims must relate to a single key pair

func ParseClaims

func ParseClaims(protected map[string]any) (*Claims, error)

func (*Claims) Hash

func (c *Claims) Hash() ([]byte, error)

Returns a hash of all client instance claims which includes a random value

func (*Claims) KeyAlgorithm

func (c *Claims) KeyAlgorithm() jwa.KeyAlgorithm

func (*Claims) PublicKey

func (c *Claims) PublicKey() jwk.Key

func (*Claims) Sign

func (c *Claims) Sign(signer crypto.Signer, algorithm jwa.KeyAlgorithm, token []byte) ([]byte, error)

This function signs the payload of the provided token with the protected headers as defined by the client instance claims and returns a jwt in compact form.

Jump to

Keyboard shortcuts

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