File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
lib/src/main/java/com/auth0/jwt Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,11 @@ static Verification init(Algorithm algorithm) throws IllegalArgumentException {
4646 }
4747
4848 /**
49- * {@link Verification} implementation that accepts all the expected Claim values for verification.
49+ * {@link Verification} implementation that accepts all the expected Claim values for verification, and
50+ * builds a {@link com.auth0.jwt.interfaces.JWTVerifier} used to verify a JWT's signature and expected claims.
51+ *
52+ * Note that this class is <strong>not</strong> thread-safe. Calling {@link #build()} returns an instance of
53+ * {@link com.auth0.jwt.interfaces.JWTVerifier} which can be reused.
5054 */
5155 public static class BaseVerification implements Verification {
5256 private final Algorithm algorithm ;
Original file line number Diff line number Diff line change 44
55
66/**
7- * Used to verify the JWT for its signature and claims.
7+ * Used to verify the JWT for its signature and claims. Implementations must be thread-safe. Instances are created
8+ * using {@link Verification}.
9+ *
10+ * <pre>
11+ * try {
12+ * JWTVerifier verifier = JWTVerifier.init(Algorithm.RSA256(publicKey, privateKey)
13+ * .withIssuer("auth0")
14+ * .build();
15+ * DecodedJWT jwt = verifier.verify("token");
16+ * } catch (JWTVerificationException e) {
17+ * // invalid signature or claims
18+ * }
19+ * </pre>
820 */
921public interface JWTVerifier {
1022
Original file line number Diff line number Diff line change 77import java .util .function .BiPredicate ;
88
99/**
10- * Constructs and holds the checks required for a JWT to be considered valid.
10+ * Constructs and holds the checks required for a JWT to be considered valid. Note that implementations are
11+ * <strong>not</strong> thread-safe. Once built by calling {@link #build()}, the resulting
12+ * {@link com.auth0.jwt.interfaces.JWTVerifier} is thread-safe.
1113 */
1214public interface Verification {
1315
You can’t perform that action at this time.
0 commit comments