001 package com.nimbusds.jose;
002
003
004 import 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 */
014 public 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 if
022 * 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 set
042 * if none.
043 */
044 public Set<EncryptionMethod> getAcceptedEncryptionMethods();
045
046
047
048 /**
049 * Sets the names of the accepted encryption methods. These correspond
050 * to the {@code enc} JWE header parameter.
051 *
052 * @param acceptedEncs The accepted encryption methods. Must be a subset
053 * of the supported encryption methods and not
054 * {@code null}.
055 */
056 public void setAcceptedEncryptionMethods(final Set<EncryptionMethod> acceptedEncs);
057 }