Documentation ¶
Index ¶
- func Decrypt(cipherText string, key string) ([]byte, error)
- func Encrypt(data []byte, key string) (string, error)
- func NewToken(payload jwt.MapClaims, signingKey string, secondsDuration int64) (string, error)
- func ParseJWT(token string, verificationKey string) (jwt.MapClaims, error)
- func ParseUnverifiedJWT(token string) (jwt.MapClaims, error)
- func RandomString(length int) string
- func RandomStringWithAlphabet(length int, alphabet string) string
- func S256Challenge(code string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseUnverifiedJWT ¶
ParseUnverifiedJWT parses JWT token and returns its claims but DOES NOT verify the signature.
func RandomString ¶
RandomString generates a random string with the specified length.
The generated string is cryptographically random and matches [A-Za-z0-9]+ (aka. it's transparent to URL-encoding).
func RandomStringWithAlphabet ¶
RandomStringWithAlphabet generates a cryptographically random string with the specified length and characters set.
func S256Challenge ¶
S256Challenge creates base64 encoded sha256 challenge string derived from code. The padding of the result base64 string is stripped per RFC 7636.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.