Package com.nimbusds.jose.crypto.impl
Class CriticalHeaderParamsDeferral
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.CriticalHeaderParamsDeferral
-
public class CriticalHeaderParamsDeferral extends java.lang.ObjectCritical (crit) header parameters deferral policy.- Version:
- 2020-04-17
- Author:
- Vladimir Dzhuvinov
- See Also:
CriticalHeaderParamsAware
-
-
Constructor Summary
Constructors Constructor Description CriticalHeaderParamsDeferral()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidensureHeaderPasses(JWEHeader header)Throws a JOSE exception if the specified JWE header doesn't pass the critical header parameters check.java.util.Set<java.lang.String>getDeferredCriticalHeaderParams()Returns the names of the critical (crit) header parameters that are deferred to the application for processing.java.util.Set<java.lang.String>getProcessedCriticalHeaderParams()Returns the names of the critical (crit) header parameters that are understood and processed.booleanheaderPasses(Header header)Returnstrueif the specified header passes the critical parameters check.voidsetDeferredCriticalHeaderParams(java.util.Set<java.lang.String> defCritHeaders)Sets the names of the critical (crit) header parameters that are deferred to the application for processing.
-
-
-
Method Detail
-
getProcessedCriticalHeaderParams
public java.util.Set<java.lang.String> getProcessedCriticalHeaderParams()
Returns the names of the critical (crit) header parameters that are understood and processed.- Returns:
- Empty immutable set.
-
getDeferredCriticalHeaderParams
public java.util.Set<java.lang.String> getDeferredCriticalHeaderParams()
Returns the names of the critical (crit) header parameters that are deferred to the application for processing.- Returns:
- The names of the critical header parameters that are deferred to the application for processing, as an unmodifiable set, empty set if none.
-
setDeferredCriticalHeaderParams
public void setDeferredCriticalHeaderParams(java.util.Set<java.lang.String> defCritHeaders)
Sets the names of the critical (crit) header parameters that are deferred to the application for processing.- Parameters:
defCritHeaders- The names of the critical header parameters that are deferred to the application for processing, empty set ornullif none.
-
headerPasses
public boolean headerPasses(Header header)
Returnstrueif the specified header passes the critical parameters check.- Parameters:
header- The JWS or JWE header to check. Must not benull.- Returns:
trueif the header passes,falseif the header contains one or more critical header parameters which are not marked for deferral to the application.
-
ensureHeaderPasses
public void ensureHeaderPasses(JWEHeader header) throws JOSEException
Throws a JOSE exception if the specified JWE header doesn't pass the critical header parameters check.- Parameters:
header- The JWE header to check. Must not benull.- Throws:
JOSEException- If the JWE header doesn't pass the check.
-
-