msgsigner

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyPath string

Functions

func ParsePrivateKey

func ParsePrivateKey(keyBuffer []byte) (*rsa.PrivateKey, error)

func ParsePublicKey

func ParsePublicKey(keyBuffer []byte) (*rsa.PublicKey, error)

func Setup

func Setup()

func Teardown

func Teardown()

Types

type CommonClaims

type CommonClaims struct {
	Message string `json:"message"`
	jwt.RegisteredClaims
}

type KeyConf

type KeyConf struct {
	PublicKey  string `mapstructure:"publickey" json:"publickey"`
	PrivateKey string `mapstructure:"privatekey" json:"privatekey"`
}

type KeyKeeper

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

func (*KeyKeeper) GetPrivateKey

func (k *KeyKeeper) GetPrivateKey() (*rsa.PrivateKey, error)

func (*KeyKeeper) GetPublicKey

func (k *KeyKeeper) GetPublicKey() (*rsa.PublicKey, error)

func (*KeyKeeper) Load

func (k *KeyKeeper) Load() error

type MsgSigner

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

func NewMsgSigner

func NewMsgSigner() *MsgSigner

func (*MsgSigner) Init

func (s *MsgSigner) Init()

func (*MsgSigner) Sign

func (s *MsgSigner) Sign(
	issuer string, subject string, audience []string, msg string, expire time.Duration,
) (string, error)

func (*MsgSigner) Verify

func (s *MsgSigner) Verify(tokenStr string) (string, error)

Jump to

Keyboard shortcuts

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