Skip to main content

jwt

实例名实例描述
ALG_ES256(string) "ES256"
ALG_ES384(string) "ES384"
ALG_ES512(string) "ES512"
ALG_HS256(string) "HS256"
ALG_HS384(string) "HS384"
ALG_HS512(string) "HS512"
ALG_NONE(string) "None"
ALG_PS256(string) "PS256"
ALG_PS384(string) "PS384"
ALG_PS512(string) "PS512"
ALG_RS256(string) "RS256"
ALG_RS384(string) "RS384"
ALG_RS512(string) "RS512"
CommonWeakJWTKeys([]string) []string{"secret", "...", "012345678901234567890123456789XY", "12345", "12345678901234567890123456789012", "61306132616264382D363136322D343163332D383364362D316366353539623436616663", "61306132616264382d363136322d343163332d383364362d316366353539623436616663", "872e4e50ce9990d8b041330c47c9ddd11bec6b503ae9386a99da8584e9bb12c4", "8zUpiGcaPkNhNGi8oyrq", "A43CC200A1BD292682598DA42DAA9FD14589F3D8BF832FFA206BE775259EE1EA", "C2A4EB068AF8ABEF18D80B1689C7D785", "GQDstcKsx0NHjPOuXOYg5MbeJ1XT0uFiwDVvVBrk", "Hello, World!", "J5hZTw1vtee0PGaoAuaW", "[107 105 97 108 105]", "kiali", "My super secret key!", "Original secret string", "R9MyWaEoyiMYViVWo8Fk4TUGWiSoaW6U1nOqXri8_XU", "RfxRP43BIKoSQ7P1GfeO", "Secret key. You can use mix guardian.gen.secretto get one", "SecretKey", "Setec Astronomy", "SignerTest", "Super Secret Key", "THE_SAME_HMAC_KEY", "ThisIsMySuperSecret", "XYZ", "YOUR_HMAC_KEY", "YoUR sUpEr S3krEt 1337 HMAC kEy HeRE", "]V@IaC1%fU,DrVI", "mix guardian.gen.secret", "a43cc200a1bd292682598da42daa9fd14589f3d8bf832ffa206be775259ee1ea", "banana", "bar", "c2a4eb068af8abef18d80b1689c7d785", "client_secret_basic", "custom", "default-key", "example-hmac-key", "example_key", "fe1a1915a379f3be5394b64d14794932", "gZH75aKtMN3Yj0iPS4hcgUuTwjAzZr9C", "guest", "hard!to-guess_secret", "has a van", "her key", "his key", "key", "key1", "key2", "key3", "kkey", "mix guardian.gen.secret", "my key", "my super secret password", "my$ecretK3y", "my_very_long_and_safe_secret_key", "mypass", "mysecretkey", "mysupersecretkey", "newSecret", "password", "secret-key", "secret123", "secret_key", "secret_key_here", "secretkey", "shared-secret", "shared_secret", "shhhhh", "shhhhhhared-secret", "some-secret-string", "super-secret-password", "super_fancy_secret", "supersecret", "symmetric key", "test-key", "testing1", "token", "too many secrets", "top secret", "verysecret", "wrong-secret", "xxx", "your-256-bit-secret", "your-384-bit-secret", "your-512-bit-secret", "your-own-jwt-secret", "your-top-secret-key", "jwt", "jwt-secret", "hmac-secret", "hs256-secret", "AC8d83&21Almnis710sds", "123456"}
函数名函数描述/介绍
jwt.AllAlgs
jwt.JWSGenerate
jwt.JWSGenerateEx
jwt.JWTGenerate
jwt.JWTGenerateEx
jwt.Parse
jwt.RemoveAlg

函数定义#

AllAlgs#

详细描述#

定义#

AllAlgs() []string

返回值#

返回值(顺序)返回值类型返回值解释
r1[]string

JWSGenerate#

详细描述#

定义#

JWSGenerate(alg string, i map[string]any, key []byte) (string, error)

参数#

参数名参数类型参数解释
algstring
imap[string]any
key[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

JWSGenerateEx#

详细描述#

定义#

JWSGenerateEx(alg string, extraHeader map[string]any, i map[string]any, key []byte) (string, error)

参数#

参数名参数类型参数解释
algstring
extraHeadermap[string]any
imap[string]any
key[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

JWTGenerate#

详细描述#

定义#

JWTGenerate(alg string, i map[string]any, key []byte) (string, error)

参数#

参数名参数类型参数解释
algstring
imap[string]any
key[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

JWTGenerateEx#

详细描述#

定义#

JWTGenerateEx(alg string, extraHeader map[string]any, i map[string]any, key []byte) (string, error)

参数#

参数名参数类型参数解释
algstring
extraHeadermap[string]any
imap[string]any
key[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

Parse#

详细描述#

定义#

Parse(tokenStr string, keys ...string) (*jwt.Token, []byte, error)

参数#

参数名参数类型参数解释
tokenStrstring
keys...string

返回值#

返回值(顺序)返回值类型返回值解释
r1*jwt.Token
r2[]byte
r3error

RemoveAlg#

详细描述#

定义#

RemoveAlg(token string) (string, error)

参数#

参数名参数类型参数解释
tokenstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error