Documentation ¶
Index ¶
- func CreateToken(authInfo msgserver.ClientAuthInfo, signingKey *ecdsa.PrivateKey) (token string, err error)
- func LoadCreateUserKP(kpPath string, writeChanges bool) (kp *ecdsa.PrivateKey, kpPub string, err error)
- func ValidateToken(clientID string, token string, signingKey *ecdsa.PrivateKey, ...) (authInfo msgserver.ClientAuthInfo, err error)
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.
Click to show internal directories.
Click to hide internal directories.