gen

package
v0.0.0-...-142450a Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SignEmblem

func SignEmblem(secretKey jwk.Key, alg *jwa.SignatureAlgorithm, token jwt.Token, lifetime int64) (jwt.Token, []byte, error)

func SignEndorsement

func SignEndorsement(secretKey jwk.Key, signingAlg *jwa.SignatureAlgorithm, token jwt.Token, endorseKey jwk.Key, pkAlg *jwa.SignatureAlgorithm, lifetime int64) (jwt.Token, []byte, error)

Types

type EmblemConfig

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

func MkEmblemCfg

func MkEmblemCfg(sk jwk.Key, alg *jwa.SignatureAlgorithm, proto jwt.Token, lifetime int64) *EmblemConfig

func (*EmblemConfig) SignToken

func (cfg *EmblemConfig) SignToken() (jwt.Token, []byte, error)

type EndorsementConfig

type EndorsementConfig struct {
	EmblemConfig
	// contains filtered or unexported fields
}

func MkEndorsementCfg

func MkEndorsementCfg(sk jwk.Key, alg *jwa.SignatureAlgorithm, proto jwt.Token, endorse jwk.Key, endorseAlg *jwa.SignatureAlgorithm, lifetime int64) *EndorsementConfig

func (*EndorsementConfig) SignToken

func (cfg *EndorsementConfig) SignToken() (jwt.Token, []byte, error)

type TokenGenerator

type TokenGenerator interface {
	// Generate a signed token. First argument is the signed token, second
	// argument the bytes of the JWS in compact serialization.
	SignToken() (jwt.Token, []byte, error)
}

Jump to

Keyboard shortcuts

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