Documentation ¶
Index ¶
- Variables
- func BuildPubKey(pubKey string) (*rsa.PublicKey, error)
- func Contains[T comparable](slice []T, element T) bool
- func DecodeJwt(jwt string) (*model.CustomClaims, error)
- func DecodePayload(payload string) (*model.CustomClaims, error)
- func GenRsaCertPair()
- func ReadPriKey(keyPath string) (*rsa.PrivateKey, error)deprecated
- func ReadPriKeyOfAbPath(abPath string) (*rsa.PrivateKey, error)
- func ReadPubKey(keyPath string) (*rsa.PublicKey, error)deprecated
- func ReadPubKeyOfAbPath(abPath string) (*rsa.PublicKey, error)
- func RemoveBearer(token string) string
- type JWTParser
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Contains ¶ added in v0.1.2
func Contains[T comparable](slice []T, element T) bool
func DecodePayload ¶ added in v0.1.2
func DecodePayload(payload string) (*model.CustomClaims, error)
func GenRsaCertPair ¶
func GenRsaCertPair()
func ReadPriKey
deprecated
added in
v0.0.2
func ReadPriKey(keyPath string) (*rsa.PrivateKey, error)
Deprecated: ReadPriKeyOfAbPath 相对路径
func ReadPriKeyOfAbPath ¶ added in v0.1.3
func ReadPriKeyOfAbPath(abPath string) (*rsa.PrivateKey, error)
ReadPriKeyOfAbPath 绝对路径
func ReadPubKey
deprecated
func ReadPubKeyOfAbPath ¶ added in v0.1.3
ReadPubKeyOfAbPath 读取公钥(绝对路径)
func RemoveBearer ¶ added in v0.1.2
RemoveBearer remove token Bearer prefix if necessary
Types ¶
type JWTParser ¶
func GetParserFromKey ¶
func GetParserOfAbPath ¶ added in v0.1.4
func (*JWTParser) ParseToken ¶
func (j *JWTParser) ParseToken(tokenString string) (*model.CustomClaims, error)
ParseToken 解析 token
Click to show internal directories.
Click to hide internal directories.