001package com.nimbusds.jwt.proc; 002 003 004import com.nimbusds.jose.crypto.factories.DefaultJWEDecrypterFactory; 005import com.nimbusds.jose.crypto.factories.DefaultJWSVerifierFactory; 006import com.nimbusds.jose.proc.JOSEProcessorConfiguration; 007import com.nimbusds.jose.proc.SecurityContext; 008 009 010/** 011 * JWT processor configuration. 012 * 013 * <p></P>Specifies the required components to process JWTs: 014 * 015 * <ul> 016 * <li>To verify signed JWTs: 017 * <ul> 018 * <li>Key selector to determine key candidate(s) for JWS 019 * verification based on the JWS header and application- 020 * specific context information. 021 * <li>Factory to construct a JWS verifier for a given key 022 * candidate and JWS header information. A 023 * {@link DefaultJWSVerifierFactory default factory} 024 * implementation is provided. 025 * </ul> 026 * <li>To decrypt encrypted JWTs: 027 * <ul> 028 * <li>Key selector to determine key candidate(s) for JWE 029 * decryption based on the JWS header and application-specific 030 * context information. 031 * <li>Factory to construct a JWE decrypter for a given key 032 * candidate and JWE header information. A 033 * {@link DefaultJWEDecrypterFactory default factory} 034 * implementation is provided. 035 * </ul> 036 * <li>Optional JWT claims set verifier. Ensures that the claims set of a 037 * JWT complies with an application's requirements. 038 * </ul> 039 * 040 * @author Vladimir Dzhuvinov 041 * @version 2016-07-25 042 */ 043public interface JWTProcessorConfiguration<C extends SecurityContext> extends JOSEProcessorConfiguration<C> { 044 045 046 /** 047 * Gets the optional JWT claims set verifier. Ensures that the claims 048 * set of a JWT complies with an application's requirements. 049 * 050 * @return The JWT claims set verifier, {@code null} if not specified. 051 */ 052 JWTClaimsSetVerifier<C> getJWTClaimsSetVerifier(); 053 054 055 /** 056 * Sets the optional JWT claims set verifier. Ensures that the claims 057 * set of a JWT complies with an application's requirements. 058 * 059 * @param claimsVerifier The JWT claims set verifier, {@code null} if 060 * not specified. 061 */ 062 void setJWTClaimsSetVerifier(final JWTClaimsSetVerifier<C> claimsVerifier); 063 064 065 /** 066 * Use {@link #getJWTClaimsVerifier()} instead. 067 */ 068 @Deprecated 069 JWTClaimsVerifier getJWTClaimsVerifier(); 070 071 072 /** 073 * Use {@link #setJWTClaimsSetVerifier} instead. 074 */ 075 @Deprecated 076 void setJWTClaimsVerifier(final JWTClaimsVerifier claimsVerifier); 077}