Documentation
¶
Index ¶
- func CreateToken(appKey string, secretkey string, username string) (string, int, error)
- func CreateTokenHMAC(appKey string, secretkey string, username string, expiration int64, ...) (string, error)
- func CreateTokenRSA(appKey string, secretkey string, username string, expiration int64, ...) (string, error)
- func GenerateRSAKeys(bits int)
- func ParseTokenHMAC(userToken string, signingKey string) (*jwt.Token, error)
- func ParseTokenRSA(userToken string, publicKey string) (*jwt.Token, error)
- func ValidateToken(userToken string, signingKey string) (map[string]interface{}, int, error)
- func ValidateTokenClient(userToken string) (map[string]interface{}, int, error)
- func ValidateTokenServer(userToken string) (map[string]interface{}, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
CreateToken create a jwt token.
func CreateTokenHMAC ¶
func CreateTokenHMAC(appKey string, secretkey string, username string, expiration int64, signingKey string) (string, error)
CreateTokenHMAC creates a jwt token by HMAC method.
func CreateTokenRSA ¶
func CreateTokenRSA(appKey string, secretkey string, username string, expiration int64, signingKeyString string) (string, error)
CreateTokenRSA creates a jwt token by RSA method.
func GenerateRSAKeys ¶
func GenerateRSAKeys(bits int)
GenerateRSAKeys generate RSA keys(private and public).
func ParseTokenHMAC ¶
ParseTokenHMAC parses token by HMAC method.
func ParseTokenRSA ¶
ParseTokenRSA parses token by RSA method. TODO: Error should be fixed. : token signature is invalid: key is of invalid type
func ValidateToken ¶
ValidateToken validates a token.
func ValidateTokenClient ¶
ValidateTokenClient validate a token that generated from client
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.