001package com.nimbusds.jose.proc; 002 003 004/** 005 * JOSE processor configuration. 006 * 007 * <p>Specifies the required components to process secured JOSE objects: 008 * 009 * <ul> 010 * <li>To verify JWS objects: 011 * <ul> 012 * <li>Key selector to determine key candidate(s) for JWS 013 * verification based on the JWS header and application- 014 * specific context information. 015 * <li>Factory to construct a JWS verifier for a given key 016 * candidate and JWS header information. 017 * </ul> 018 * <li>To decrypt JWT objects: 019 * <ul> 020 * <li>Key selector to determine key candidate(s) for JWE 021 * decryption based on the JWS header and application-specific 022 * context information. 023 * <li>Factory to construct a JWE decrypter for a given key 024 * candidate and JWE header information. 025 * </ul> 026 * </ul> 027 * 028 * @author Vladimir Dzhuvinov 029 * @version 2015-08-22 030 */ 031public interface JOSEProcessorConfiguration <C extends SecurityContext> { 032 033 034 /** 035 * Gets the JWS key selector. 036 * 037 * @return The JWS key selector, {@code null} if not specified. 038 */ 039 JWSKeySelector<C> getJWSKeySelector(); 040 041 042 /** 043 * Sets the JWS key selector. 044 * 045 * @param jwsKeySelector The JWS key selector, {@code null} if not 046 * specified. 047 */ 048 void setJWSKeySelector(final JWSKeySelector<C> jwsKeySelector); 049 050 051 /** 052 * Gets the JWE key selector. 053 * 054 * @return The JWE key selector, {@code null} if not specified. 055 */ 056 JWEKeySelector<C> getJWEKeySelector(); 057 058 059 /** 060 * Sets the JWE key selector. 061 * 062 * @param jweKeySelector The JWE key selector, {@code null} if not 063 * specified. 064 */ 065 void setJWEKeySelector(final JWEKeySelector<C> jweKeySelector); 066 067 068 /** 069 * Gets the factory for creating JWS verifier instances. 070 * 071 * @return The JWS verifier factory, {@code null} if not specified. 072 */ 073 JWSVerifierFactory getJWSVerifierFactory(); 074 075 076 /** 077 * Sets the factory for creating JWS verifier instances. 078 * 079 * @param factory The JWS verifier factory, {@code null} if not 080 * specified. 081 */ 082 void setJWSVerifierFactory(final JWSVerifierFactory factory); 083 084 085 /** 086 * Gets the factory for creating JWE decrypter instances. 087 * 088 * @return The JWE decrypter factory, {@code null} if not specified. 089 */ 090 JWEDecrypterFactory getJWEDecrypterFactory(); 091 092 093 /** 094 * Sets the factory for creating JWE decrypter instances. 095 * 096 * @param factory The JWE decrypter factory, {@code null} if not 097 * specified. 098 */ 099 void setJWEDecrypterFactory(final JWEDecrypterFactory factory); 100}