Class JwksSignatureUtils
java.lang.Object
io.micronaut.security.token.jwt.signature.jwks.JwksSignatureUtils
Utility class to verify signatures with a 
JWKSet.- 
Method SummaryModifier and TypeMethodDescriptionstatic List<com.nimbusds.jose.jwk.JWK>matches(com.nimbusds.jwt.SignedJWT jwt, @Nullable com.nimbusds.jose.jwk.JWKSet jwkSet, @Nullable com.nimbusds.jose.jwk.KeyType keyType) Calculates a list of JWK matches for a JWT.static StringsupportedAlgorithmsMessage(com.nimbusds.jose.jwk.JWKSet jwkSet) static StringsupportedAlgorithmsMessage(List<com.nimbusds.jose.jwk.JWK> keys) static booleansupports(com.nimbusds.jose.JWSAlgorithm algorithm, com.nimbusds.jose.jwk.JWKSet jwkSet) Whether this signature configuration supports this algorithm.static booleanWhether this signature configuration supports this algorithm.static booleanverify(com.nimbusds.jwt.SignedJWT jwt, com.nimbusds.jose.jwk.JWKSet jwkSet, JwkValidator jwkValidator) Verify a signed JWT.static booleanverify(JwkValidator jwkValidator, List<com.nimbusds.jose.jwk.JWK> matches, com.nimbusds.jwt.SignedJWT jwt) returns true if any JWK match is able to verify the JWT signature.
- 
Method Details- 
verifypublic static boolean verify(com.nimbusds.jwt.SignedJWT jwt, com.nimbusds.jose.jwk.JWKSet jwkSet, JwkValidator jwkValidator) throws com.nimbusds.jose.JOSEException Verify a signed JWT.- Parameters:
- jwkSet- JSON Web Key Set
- jwt- the signed JWT
- jwkValidator- JWK Validator
- Returns:
- whether the signed JWT is verified
- Throws:
- com.nimbusds.jose.JOSEException- exception when verifying the JWT
 
- 
supportspublic static boolean supports(com.nimbusds.jose.JWSAlgorithm algorithm, com.nimbusds.jose.jwk.JWKSet jwkSet) Whether this signature configuration supports this algorithm.- Parameters:
- jwkSet- JSON Web Key Set
- algorithm- the signature algorithm
- Returns:
- whether this signature configuration supports this algorithm
 
- 
supportspublic static boolean supports(com.nimbusds.jose.JWSAlgorithm algorithm, List<com.nimbusds.jose.jwk.JWK> keys) Whether this signature configuration supports this algorithm.- Parameters:
- keys- JSON Web Keys
- algorithm- the signature algorithm
- Returns:
- whether this signature configuration supports this algorithm
 
- 
supportedAlgorithmsMessage- Parameters:
- jwkSet- JSON Web Key Set
- Returns:
- A message indicating the supported algorithms.
 
- 
supportedAlgorithmsMessage- Parameters:
- keys- JSON Web Keys
- Returns:
- A message indicating the supported algorithms.
 
- 
verifypublic static boolean verify(JwkValidator jwkValidator, List<com.nimbusds.jose.jwk.JWK> matches, com.nimbusds.jwt.SignedJWT jwt) returns true if any JWK match is able to verify the JWT signature.- Parameters:
- jwkValidator- JWK Validator
- matches- A List of JSON Web key matches.
- jwt- A JWT to be verified.
- Returns:
- true if the JWT signature could be verified.
 
- 
matchespublic static List<com.nimbusds.jose.jwk.JWK> matches(com.nimbusds.jwt.SignedJWT jwt, @Nullable @Nullable com.nimbusds.jose.jwk.JWKSet jwkSet, @Nullable @Nullable com.nimbusds.jose.jwk.KeyType keyType) Calculates a list of JWK matches for a JWT.- Parameters:
- jwt- A Signed JWT
- jwkSet- A JSON Web Key Set
- keyType- Key Type
- Returns:
- a List of JSON Web Keys
 
 
-