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 Details

  • 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

      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 or null if none.
    • headerPasses

      public boolean headerPasses(Header header)
      Returns true if the specified header passes the critical parameters check.
      Parameters:
      header - The JWS or JWE header to check. Must not be null.
      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 be null.
      Throws:
      JOSEException - If the JWE header doesn't pass the check.