T
- the type of object to return after invoking the Jwt.accept(JwtVisitor)
method.public interface JwtVisitor<T>
Jwt
instances. Visitor implementations define logic for a specific JWT subtype or payload subtype
avoiding type-checking if-then-else conditionals in favor of type-safe method dispatch when encountering a JWT.Modifier and Type | Method and Description |
---|---|
T |
visit(Jwe<?> jwe)
Handles an encountered JSON Web Encryption (aka 'JWE') message that has been authenticated and decrypted.
|
T |
visit(Jws<?> jws)
Handles an encountered JSON Web Signature (aka 'JWS') message that has been cryptographically
verified/authenticated.
|
T |
visit(Jwt<?,?> jwt)
Handles an encountered Unsecured JWT that has not been cryptographically secured at all.
|
T visit(Jwt<?,?> jwt)
Jwt.getPayload()
to determine if it is a Claims
instance or a byte[]
array.
If the payload is a byte[]
array, and the JWT creator has set the (optional)
Header.getContentType()
value, the application may inspect that value to determine how to convert
the byte array to the final type as desired.
jwt
- the parsed Unsecured JWT.null
if no return value is necessary.T visit(Jws<?> jws)
Jwt.getPayload()
determine if it is a
Claims
instance or a byte[]
array.
If the payload is a byte[]
array, and the JWS creator has set the (optional)
Header.getContentType()
value, the application may inspect that value to determine how to convert
the byte array to the final type as desired.
jws
- the parsed verified/authenticated JWS.null
if no return value is necessary.T visit(Jwe<?> jwe)
Jwt.getPayload()
to determine if it is a Claims
instance or a byte[]
array.
If the payload is a byte[]
array, and the JWE creator has set the (optional)
Header.getContentType()
value, the application may inspect that value to determine how to convert
the byte array to the final type as desired.
jwe
- the parsed authenticated and decrypted JWE.null
if no return value is necessary.Copyright © 2014–2023 jsonwebtoken.io. All rights reserved.