Documentation
¶
Index ¶
- func ParseAccessToken(tokenValue []byte, claims jwt.Claims) (*jwt.Token, []string, error)
- func ParseRSAPrivateKey(pemData string) (*rsa.PrivateKey, error)
- func ParseRSAPublicKey(pemData string) (*rsa.PublicKey, error)
- func ParseUnverified(tokenString string, claims jwt.Claims) (*jwt.Token, []string, error)
- type JWT
- type OptionJWT
- func WithECDSAPrivateKey(secret *ecdsa.PrivateKey) OptionJWT
- func WithECDSAPublicKey(secret *ecdsa.PublicKey) OptionJWT
- func WithED25519PrivateKey(secret ed25519.PrivateKey) OptionJWT
- func WithED25519PublicKey(secret ed25519.PublicKey) OptionJWT
- func WithHMAC(secret []byte) OptionJWT
- func WithKID(kid string) OptionJWT
- func WithMethod(method jwt.SigningMethod) OptionJWT
- func WithRSAPrivateKey(secret *rsa.PrivateKey) OptionJWT
- func WithRSAPublicKey(secret *rsa.PublicKey) OptionJWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAccessToken ¶
func ParseRSAPrivateKey ¶
func ParseRSAPrivateKey(pemData string) (*rsa.PrivateKey, error)
func ParseUnverified ¶
Types ¶
type JWT ¶
type JWT struct {
// contains filtered or unexported fields
}
func NewJWT ¶
NewJWT function get private key and options and return a new JWT instance.
Default expiration function is time.Now().Add(time.Hour).Unix().
func (*JWT) Generate ¶
Generate function get custom values and add 'exp' as expires at with expDate argument with unix format.
type OptionJWT ¶
type OptionJWT func(options *optionJWT)
func WithECDSAPrivateKey ¶
func WithECDSAPrivateKey(secret *ecdsa.PrivateKey) OptionJWT
func WithECDSAPublicKey ¶
func WithED25519PrivateKey ¶
func WithED25519PrivateKey(secret ed25519.PrivateKey) OptionJWT
func WithED25519PublicKey ¶
func WithMethod ¶
func WithMethod(method jwt.SigningMethod) OptionJWT
WithMethod sets the signing method for the JWT.
func WithRSAPrivateKey ¶
func WithRSAPrivateKey(secret *rsa.PrivateKey) OptionJWT
func WithRSAPublicKey ¶
Click to show internal directories.
Click to hide internal directories.