Package com.nimbusds.jose.crypto.impl
Class CriticalHeaderParamsDeferral
- java.lang.Object
-
- com.nimbusds.jose.crypto.impl.CriticalHeaderParamsDeferral
-
public class CriticalHeaderParamsDeferral extends Object
Critical (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 void
ensureHeaderPasses(JWEHeader header)
Throws a JOSE exception if the specified JWE header doesn't pass the critical header parameters check.Set<String>
getDeferredCriticalHeaderParams()
Returns the names of the critical (crit
) header parameters that are deferred to the application for processing.Set<String>
getProcessedCriticalHeaderParams()
Returns the names of the critical (crit
) header parameters that are understood and processed.boolean
headerPasses(Header header)
Returnstrue
if the specified header passes the critical parameters check.void
setDeferredCriticalHeaderParams(Set<String> defCritHeaders)
Sets the names of the critical (crit
) header parameters that are deferred to the application for processing.
-
-
-
Constructor Detail
-
CriticalHeaderParamsDeferral
public CriticalHeaderParamsDeferral()
-
-
Method Detail
-
getProcessedCriticalHeaderParams
public Set<String> getProcessedCriticalHeaderParams()
Returns the names of the critical (crit
) header parameters that are understood and processed.- Returns:
- Empty immutable set.
-
getDeferredCriticalHeaderParams
public Set<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(Set<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 ornull
if none.
-
headerPasses
public boolean headerPasses(Header header)
Returnstrue
if the specified header passes the critical parameters check.- Parameters:
header
- The JWS or JWE header to check. Must not benull
.- Returns:
true
if the header passes,false
if 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.
-
-