001package com.nimbusds.jose;
002
003
004import java.util.Set;
005
006
007/**
008 * JSON Web Signature (JWS) verifier or JSON Web Encryption (JWE) decrypter
009 * that supports processing and / or deferral of critical ({@code crit}) header
010 * parameters.
011 *
012 * <p>JWS verification / JWE decryption will fail with a {@link JOSEException}
013 * if a critical header is encountered that is neither processed by the
014 * verifier / decrypter nor deferred to the application.
015 *
016 * @author Vladimir Dzhuvinov
017 * @version 2015-04-21
018 */
019public interface CriticalHeaderParamsAware {
020
021
022        /**
023         * Returns the names of the critical ({@code crit}) header parameters
024         * that are understood and processed by the JWS verifier / JWE
025         * decrypter.
026         *
027         * @return The names of the critical header parameters that are
028         *         understood and processed, empty set if none.
029         */
030        Set<String> getProcessedCriticalHeaderParams();
031
032
033        /**
034         * Returns the names of the critical ({@code crit}) header parameters
035         * that are deferred to the application for processing and will be
036         * ignored by the JWS verifier / JWE decrypter.
037         *
038         * @return The names of the critical header parameters that are
039         *         deferred to the application for processing, empty set if
040         *         none.
041         */
042        Set<String> getDeferredCriticalHeaderParams();
043}