Package com.nimbusds.jwt.proc
Interface JWTProcessor<C extends SecurityContext>
- All Known Subinterfaces:
ConfigurableJWTProcessor<C>
- All Known Implementing Classes:
DefaultJWTProcessor
public interface JWTProcessor<C extends SecurityContext>
Interface for parsing and processing
unsecured
(plain), signed
and
encrypted
JSON Web Tokens (JWTs).
An optional context parameter is available to facilitate passing of
additional data between the caller and the underlying JOSE processor (in
both directions).- Version:
- 2015-08-20
- Author:
- Vladimir Dzhuvinov
-
Method Summary
Modifier and TypeMethodDescriptionprocess
(EncryptedJWT encryptedJWT, C context) Processes the specified encrypted JWT by decrypting it.Processes the specified JWT (unsecured, signed or encrypted).Processes the specified unsecured (plain) JWT, typically by checking its context.Processes the specified signed JWT by verifying its signature.Parses and processes the specified JWT (unsecured, signed or encrypted).
-
Method Details
-
process
JWTClaimsSet process(String jwtString, C context) throws ParseException, BadJOSEException, JOSEException Parses and processes the specified JWT (unsecured, signed or encrypted).- Parameters:
jwtString
- The JWT, compact-encoded to a URL-safe string. Must not benull
.context
- Optional context,null
if not required.- Returns:
- The JWT claims set on success.
- Throws:
ParseException
- If the string couldn't be parsed to a valid JWT.BadJOSEException
- If the JWT is rejected.JOSEException
- If an internal processing exception is encountered.
-
process
Processes the specified JWT (unsecured, signed or encrypted).- Parameters:
jwt
- The JWT. Must not benull
.context
- Optional context,null
if not required.- Returns:
- The JWT claims set on success.
- Throws:
BadJOSEException
- If the JWT is rejected.JOSEException
- If an internal processing exception is encountered.
-
process
Processes the specified unsecured (plain) JWT, typically by checking its context.- Parameters:
plainJWT
- The unsecured (plain) JWT. Notnull
.context
- Optional context,null
if not required.- Returns:
- The JWT claims set on success.
- Throws:
BadJOSEException
- If the unsecured (plain) JWT is rejected, after examining the context or due to the payload not being a JSON object.JOSEException
- If an internal processing exception is encountered.
-
process
Processes the specified signed JWT by verifying its signature. The key candidate(s) are selected by examining the JWS header and / or the message context.- Parameters:
signedJWT
- The signed JWT. Notnull
.context
- Optional context,null
if not required.- Returns:
- The JWT claims set on success.
- Throws:
BadJOSEException
- If the signed JWT is rejected, typically due to a bad signature or the payload not being a JSON object.JOSEException
- If an internal processing exception is encountered.
-
process
Processes the specified encrypted JWT by decrypting it. The key candidate(s) are selected by examining the JWS header and / or the message context.- Parameters:
encryptedJWT
- The encrypted JWT. Notnull
.context
- Optional context,null
if not required.- Returns:
- The JWT claims set on success.
- Throws:
BadJOSEException
- If the encrypted JWT is rejected, typically due to failed decryption or the payload not being a JSON object.JOSEException
- If an internal processing exception is encountered.
-