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 processingunsecured
(plain),signed
andencrypted
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JWTClaimsSet
process(EncryptedJWT encryptedJWT, C context)
Processes the specified encrypted JWT by decrypting it.JWTClaimsSet
process(JWT jwt, C context)
Processes the specified JWT (unsecured, signed or encrypted).JWTClaimsSet
process(PlainJWT plainJWT, C context)
Processes the specified unsecured (plain) JWT, typically by checking its context.JWTClaimsSet
process(SignedJWT signedJWT, C context)
Processes the specified signed JWT by verifying its signature.JWTClaimsSet
process(String jwtString, C context)
Parses and processes the specified JWT (unsecured, signed or encrypted).
-
-
-
Method Detail
-
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
JWTClaimsSet process(JWT jwt, C context) throws BadJOSEException, JOSEException
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
JWTClaimsSet process(PlainJWT plainJWT, C context) throws BadJOSEException, JOSEException
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
JWTClaimsSet process(SignedJWT signedJWT, C context) throws BadJOSEException, JOSEException
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
JWTClaimsSet process(EncryptedJWT encryptedJWT, C context) throws BadJOSEException, JOSEException
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.
-
-