jwtauth

package
v0.0.0-...-147f0cf Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(authInfo msgserver.ClientAuthInfo, signingKey *ecdsa.PrivateKey) (token string, err error)

CreateToken creates a signed JWT authtoken for a client.

func LoadCreateUserKP

func LoadCreateUserKP(kpPath string, writeChanges bool) (kp *ecdsa.PrivateKey, kpPub string, err error)

LoadCreateUserKP loads a user keypair, or creates one if it doesn't exist

kpPath is file of key or "" to just create it
writeChanges if a file is given and key is generated

This returns the public/private key pair with a public key string, or an error.

func ValidateToken

func ValidateToken(clientID string, token string, signingKey *ecdsa.PrivateKey, signedNonce string, nonce string) (
	authInfo msgserver.ClientAuthInfo, err error)

ValidateToken verifies the given JWT token and returns its claims. optionally verify the signed nonce using the client's public key. This returns the auth info stored in the token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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