001package com.nimbusds.jose;
002
003
004import java.util.Set;
005
006
007/**
008 * JSON Web Encryption (JWE) header filter. Specifies accepted JWE algorithms,
009 * encryption methods, and header parameters.
010 *
011 * @author Vladimir Dzhuvinov
012 * @version $version$ (2012-10-16)
013 */
014public interface JWEHeaderFilter extends HeaderFilter {
015
016
017        /**
018         * Gets the names of the accepted JWE algorithms. These correspond to
019         * the {@code alg} JWE header parameter.
020         *
021         * @return The accepted JWE algorithms, as a read-only set, empty set 
022         *         if none.
023         */
024        public Set<JWEAlgorithm> getAcceptedAlgorithms();
025
026
027        /**
028         * Sets the names of the accepted JWE algorithms. These correspond to 
029         * the {@code alg} JWE header parameter. 
030         *
031         * @param acceptedAlgs The accepted JWE algorithms. Must be a subset of
032         *                     the supported algorithms and not {@code null}.
033         */
034        public void setAcceptedAlgorithms(Set<JWEAlgorithm> acceptedAlgs);
035
036
037        /**
038         * Gets the names of the accepted encryption methods. These correspond 
039         * to the {@code enc} JWE header parameter.
040         *
041         * @return The accepted encryption methods, as a read-only set, empty 
042         *         set if none.
043         */
044        public Set<EncryptionMethod> getAcceptedEncryptionMethods();
045
046        
047        /**
048         * Sets the names of the accepted encryption methods. These correspond 
049         * to the {@code enc} JWE header parameter.
050         *
051         * @param acceptedEncs The accepted encryption methods. Must be a 
052         *                     subset of the supported encryption methods and 
053         *                     not {@code null}.
054         */
055        public void setAcceptedEncryptionMethods(final Set<EncryptionMethod> acceptedEncs);
056}