Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/golang-jwt/jwt
/ functions
Functions
181 in github.com/golang-jwt/jwt
⨍
Functions
181
◇
Types & classes
33
↓ 12 callers
Method
Verify
(signingString, signature string, key interface{})
signing_method.go:12
↓ 11 callers
Method
Sign
Returns nil if signature is valid
signing_method.go:13
↓ 10 callers
Method
Alg
Returns encoded signature or error
signing_method.go:14
↓ 8 callers
Method
SignedString
SignedString creates and returns a complete, signed JWT. The token is signed using the SigningMethod specified in the token.
token.go:64
↓ 7 callers
Method
Error
Error is the implementation of the err interface.
errors.go:58
↓ 7 callers
Method
ExtractToken
(*http.Request)
request/extractor.go:18
↓ 7 callers
Method
ParseWithClaims
ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims interface. This provides default val
parser.go:52
↓ 7 callers
Function
benchmarkSigning
Helper method for benchmarking various signing methods
parser_test.go:722
↓ 6 callers
Function
DecodeSegment
DecodeSegment decodes a JWT specific base64url encoding with padding stripped Deprecated: In a future release, we will demote this function to a non-
token.go:129
↓ 6 callers
Function
EncodeSegment
EncodeSegment encodes a JWT specific base64url encoding with padding stripped Deprecated: In a future release, we will demote this function to a non-
token.go:121
↓ 6 callers
Method
Parse
Parse parses, validates, verifies the signature and returns the parsed token. keyFunc will receive the parsed token and should return the key for vali
parser.go:41
↓ 6 callers
Function
RegisterSigningMethod
RegisterSigningMethod registers the "alg" name and a factory function for signing method. This is typically done during init() in the method's impleme
signing_method.go:19
↓ 4 callers
Function
NewValidationError
NewValidationError is a helper for constructing a ValidationError with a string error message
errors.go:43
↓ 4 callers
Method
Set
(arg string)
cmd/jwt/main.go:337
↓ 4 callers
Method
String
()
cmd/jwt/main.go:332
↓ 4 callers
Function
makeExampleRequest
(method, path string, headers map[string]string, urlArgs url.Values)
request/extractor_test.go:85
↓ 4 callers
Function
newNumericDateFromSeconds
newNumericDateFromSeconds creates a new *NumericDate out of a float64 representing a UNIX epoch with the float fraction representing non-integer secon
types.go:44
↓ 4 callers
Function
signToken
signToken creates and returns a signed JWT token using signingMethod.
parser_test.go:327
↓ 4 callers
Method
valid
No errors
errors.go:74
↓ 3 callers
Method
Is
Is checks if this ValidationError is of the supplied error. We are first checking for the exact error message by comparing the inner error message. If
errors.go:81
↓ 3 callers
Function
LoadRSAPrivateKeyFromDisk
(location string)
test/helpers.go:11
↓ 3 callers
Function
LoadRSAPublicKeyFromDisk
(location string)
test/helpers.go:23
↓ 3 callers
Method
ParseUnverified
ParseUnverified parses the token but doesn't validate the signature. WARNING: Don't use this method unless you know what you're doing. It's only eve
parser.go:125
↓ 3 callers
Method
SigningString
SigningString generates the signing string. This is the most expensive part of the whole deal. Unless you need this for something special, just go s
token.go:80
↓ 3 callers
Method
VerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). If req is false, it will return true, if exp is unset.
map_claims.go:37
↓ 3 callers
Function
fatal
(err error)
http_example_test.go:63
↓ 3 callers
Function
loadData
Helper func: Read input from specified file or stdin
cmd/jwt/main.go:76
↓ 3 callers
Function
verifyAud
----- helpers
claims.go:220
↓ 3 callers
Function
verifyExp
(exp *time.Time, now time.Time, required bool)
claims.go:243
↓ 3 callers
Function
verifyIat
(iat *time.Time, now time.Time, required bool)
claims.go:250
↓ 3 callers
Function
verifyIss
(iss string, cmp string, required bool)
claims.go:264
↓ 3 callers
Function
verifyNbf
(nbf *time.Time, now time.Time, required bool)
claims.go:257
↓ 2 callers
Function
MakeSampleToken
MakeSampleToken creates and returns a encoded JWT token that has been signed with the specified cryptographic key.
test/helpers.go:36
↓ 2 callers
Function
NewParser
NewParser creates a new Parser with the specified options
parser.go:28
↓ 2 callers
Function
ParseFromRequest
ParseFromRequest extracts and parses a JWT token from an HTTP request. This behaves the same as Parse, but accepts a request and an extractor instead
request/request.go:15
↓ 2 callers
Method
VerifyIssuedAt
VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
map_claims.go:63
↓ 2 callers
Method
VerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
map_claims.go:89
↓ 2 callers
Function
WithClaims
WithClaims parses with custom claims
request/request.go:59
↓ 2 callers
Function
createToken
(user string)
http_example_test.go:139
↓ 2 callers
Function
isEd
()
cmd/jwt/main.go:303
↓ 2 callers
Function
isEs
()
cmd/jwt/main.go:295
↓ 2 callers
Function
isNone
()
cmd/jwt/main.go:307
↓ 2 callers
Function
isRs
()
cmd/jwt/main.go:299
↓ 2 callers
Function
printJSON
Print a json object in accordance with the prophecy (or the command line options)
cmd/jwt/main.go:98
↓ 1 callers
Function
GetSigningMethod
GetSigningMethod retrieves a signing method from an "alg" string
signing_method.go:27
↓ 1 callers
Function
LoadECPrivateKeyFromDisk
(location string)
test/helpers.go:47
↓ 1 callers
Function
LoadECPublicKeyFromDisk
(location string)
test/helpers.go:59
↓ 1 callers
Method
MarshalJSON
MarshalJSON is an implementation of the json.RawMessage interface and serializes the UNIX epoch represented in NumericDate to a byte array, using the
types.go:51
↓ 1 callers
Function
NewNumericDate
NewNumericDate constructs a new *NumericDate from a standard library time.Time struct. It will truncate the timestamp according to the precision speci
types.go:38
↓ 1 callers
Function
NewWithClaims
NewWithClaims creates a new Token with the specified signing method and claims.
token.go:51
↓ 1 callers
Function
ParseFromRequestWithClaims
ParseFromRequestWithClaims is an alias for ParseFromRequest but with custom Claims type. Deprecated: use ParseFromRequest and the WithClaims option
request/request.go:45
↓ 1 callers
Method
Unwrap
Unwrap gives errors.Is and errors.As access to the inner error.
errors.go:69
↓ 1 callers
Method
Valid
()
claims.go:12
↓ 1 callers
Method
VerifyAudience
VerifyAudience Compares the aud claim against cmp. If required is false, this method will return true if the value matches or is unset
map_claims.go:16
↓ 1 callers
Method
VerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp < exp). If req is false, it will return true, if exp is unset.
claims.go:88
↓ 1 callers
Method
VerifyExpiresAt
VerifyExpiresAt compares the exp claim against cmp (cmp < exp). If req is false, it will return true, if exp is unset.
claims.go:181
↓ 1 callers
Method
VerifyIssuedAt
VerifyIssuedAt compares the iat claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
claims.go:98
↓ 1 callers
Method
VerifyIssuedAt
VerifyIssuedAt compares the iat claim against cmp (cmp >= iat). If req is false, it will return true, if iat is unset.
claims.go:192
↓ 1 callers
Method
VerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
claims.go:108
↓ 1 callers
Method
VerifyNotBefore
VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). If req is false, it will return true, if nbf is unset.
claims.go:203
↓ 1 callers
Function
algHelp
()
cmd/jwt/main.go:311
↓ 1 callers
Function
benchmarkParsing
Helper method for benchmarking various parsing methods
parser_test.go:707
↓ 1 callers
Function
makeToken
(method jwt.SigningMethod)
rsa_pss_test.go:134
↓ 1 callers
Function
showToken
showToken pretty-prints the token on the command line.
cmd/jwt/main.go:263
↓ 1 callers
Function
signToken
Create, sign, and output a token. This is a great, simple example of how to use this library to create and sign a token.
cmd/jwt/main.go:175
↓ 1 callers
Function
start
Figure out which thing to do and then do that
cmd/jwt/main.go:62
↓ 1 callers
Function
verify
(signingMethod jwt.SigningMethod, token string)
rsa_pss_test.go:147
↓ 1 callers
Function
verifyToken
Verify a token and output the claims. This is a great example of how to verify and view a token.
cmd/jwt/main.go:117
Method
Alg
()
rsa.go:43
Method
Alg
()
ecdsa.go:52
Method
Alg
()
ed25519.go:31
Method
Alg
()
hmac.go:44
Method
Alg
()
none.go:23
Function
BenchmarkECDSAParsing
(b *testing.B)
ecdsa_test.go:109
Function
BenchmarkECDSASigning
(b *testing.B)
ecdsa_test.go:127
Function
BenchmarkHS256Signing
(b *testing.B)
hmac_test.go:82
Function
BenchmarkHS384Signing
(b *testing.B)
hmac_test.go:86
Function
BenchmarkHS512Signing
(b *testing.B)
hmac_test.go:90
Function
BenchmarkParseUnverified
(b *testing.B)
parser_test.go:678
Function
BenchmarkRS256Signing
(b *testing.B)
rsa_test.go:167
Function
BenchmarkRS384Signing
(b *testing.B)
rsa_test.go:177
Function
BenchmarkRS512Signing
(b *testing.B)
rsa_test.go:187
Function
BenchmarkRSAParsing
(b *testing.B)
rsa_test.go:153
Function
BenchmarkToken_SigningString
(b *testing.B)
token_test.go:63
Function
ExampleArgumentExtractor
()
request/extractor_example_test.go:23
Function
ExampleHeaderExtractor
()
request/extractor_example_test.go:12
Function
ExampleNewWithClaims_customClaimsType
Example creating a token using a custom claims type. The RegisteredClaims is embedded in the custom type to allow for easy encoding, parsing and valid
example_test.go:33
Function
ExampleNewWithClaims_registeredClaims
Example (atypical) using the RegisteredClaims type by itself to parse a token. The RegisteredClaims type is designed to be embedded into your custom t
example_test.go:16
Function
ExampleNew_hmac
Example creating, signing, and encoding a JWT token using the HMAC signing method
hmac_example_test.go:26
Function
ExampleParseWithClaims_customClaimsType
Example creating a token using a custom claims type. The StandardClaim is embedded in the custom type to allow for easy encoding, parsing and validat
example_test.go:75
Function
ExampleParse_errorChecking
An example of parsing the error types using bitfield checks
example_test.go:97
Function
ExampleParse_hmac
Example parsing and validating a token using the HMAC signing method
hmac_example_test.go:42
Function
Example_getTokenViaHTTP
()
http_example_test.go:81
Function
Example_useTokenViaHTTP
()
http_example_test.go:115
Method
ExtractToken
(req *http.Request)
request/extractor.go:25
Method
ExtractToken
(req *http.Request)
request/extractor.go:40
Method
ExtractToken
(req *http.Request)
request/extractor.go:57
Method
ExtractToken
(req *http.Request)
request/extractor.go:76
Method
ExtractToken
(req *http.Request)
request/extractor.go:89
Function
GetAlgorithms
GetAlgorithms returns a list of registered "alg" names
signing_method.go:38
next →
1–100 of 181, ranked by callers