public final class JwtTokenValidatorUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Optional<com.nimbusds.jwt.JWT> |
parseJwtIfValidSignature(java.lang.String token,
java.util.List<SignatureConfiguration> signatureConfigurations,
java.util.List<EncryptionConfiguration> encryptionConfigurations) |
static java.util.Optional<com.nimbusds.jwt.JWT> |
validateEncryptedJWTSignature(com.nimbusds.jwt.EncryptedJWT encryptedJWT,
java.lang.String token,
java.util.List<SignatureConfiguration> signatureConfigurations,
java.util.List<EncryptionConfiguration> encryptionConfigurations)
Validates a encrypted JWT Signature.
|
static java.util.Optional<com.nimbusds.jwt.JWT> |
validateJwtSignatureAndClaims(java.lang.String token,
java.util.Collection<? extends JwtClaimsValidator> claimsValidators,
java.util.List<SignatureConfiguration> signatureConfigurations,
java.util.List<EncryptionConfiguration> encryptionConfigurations)
Validates JWT signature and Claims.
|
static java.util.Optional<com.nimbusds.jwt.JWT> |
validatePlainJWTSignature(com.nimbusds.jwt.JWT jwt,
java.util.List<SignatureConfiguration> signatureConfigurations)
Validates the Signature of a plain JWT.
|
static java.util.Optional<com.nimbusds.jwt.JWT> |
validateSignedJWTSignature(com.nimbusds.jwt.SignedJWT signedJWT,
java.util.List<SignatureConfiguration> signatureConfigurations)
Validates a Signed JWT signature.
|
static boolean |
verifyClaims(JwtClaims claims,
java.util.Collection<? extends JwtClaimsValidator> claimsValidators)
Verifies the provided claims with the provided validators.
|
public static java.util.Optional<com.nimbusds.jwt.JWT> validatePlainJWTSignature(com.nimbusds.jwt.JWT jwt, java.util.List<SignatureConfiguration> signatureConfigurations)
jwt
- a JWT TokensignatureConfigurations
- The signature configurationspublic static java.util.Optional<com.nimbusds.jwt.JWT> validateSignedJWTSignature(com.nimbusds.jwt.SignedJWT signedJWT, java.util.List<SignatureConfiguration> signatureConfigurations)
signedJWT
- a Signed JWT TokensignatureConfigurations
- The signature configurationspublic static boolean verifyClaims(JwtClaims claims, java.util.Collection<? extends JwtClaimsValidator> claimsValidators)
claims
- JWT ClaimsclaimsValidators
- The claims validatorspublic static java.util.Optional<com.nimbusds.jwt.JWT> validateEncryptedJWTSignature(@Nonnull com.nimbusds.jwt.EncryptedJWT encryptedJWT, @Nonnull java.lang.String token, @Nonnull java.util.List<SignatureConfiguration> signatureConfigurations, @Nonnull java.util.List<EncryptionConfiguration> encryptionConfigurations)
encryptedJWT
- a encrytped JWT Tokentoken
- the JWT token as StringsignatureConfigurations
- The signature configurationsencryptionConfigurations
- The encryption configurationspublic static java.util.Optional<com.nimbusds.jwt.JWT> validateJwtSignatureAndClaims(java.lang.String token, java.util.Collection<? extends JwtClaimsValidator> claimsValidators, java.util.List<SignatureConfiguration> signatureConfigurations, java.util.List<EncryptionConfiguration> encryptionConfigurations)
token
- A JWT tokenclaimsValidators
- a Collection of claims Validators.signatureConfigurations
- The signature configurationsencryptionConfigurations
- The encryption configurationspublic static java.util.Optional<com.nimbusds.jwt.JWT> parseJwtIfValidSignature(java.lang.String token, java.util.List<SignatureConfiguration> signatureConfigurations, java.util.List<EncryptionConfiguration> encryptionConfigurations)
token
- A JWT token stringsignatureConfigurations
- The signature configurationsencryptionConfigurations
- The encryption configurations