Package com.nimbusds.jose.crypto.impl
Class CriticalHeaderParamsDeferral
java.lang.Object
com.nimbusds.jose.crypto.impl.CriticalHeaderParamsDeferral
Critical (
crit
) header parameters deferral policy.- Version:
- 2020-04-17
- Author:
- Vladimir Dzhuvinov
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
ensureHeaderPasses
(JWEHeader header) Throws a JOSE exception if the specified JWE header doesn't pass the critical header parameters check.Returns the names of the critical (crit
) header parameters that are deferred to the application for processing.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 Details
-
CriticalHeaderParamsDeferral
public CriticalHeaderParamsDeferral()
-
-
Method Details
-
getProcessedCriticalHeaderParams
Returns the names of the critical (crit
) header parameters that are understood and processed.- Returns:
- Empty immutable set.
-
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
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
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
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.
-