private function _preparePolicyConstraints(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        $extensions = $cert->tbsCertificate()->extensions();
        if (!$extensions->hasPolicyConstraints()) {
            return $state;
        }
        $ext = $extensions->policyConstraints();
        // (i.1)
        if ($ext->hasRequireExplicitPolicy() &&
             $ext->requireExplicitPolicy() < $state->explicitPolicy()) {
            $state = $state->withExplicitPolicy($ext->requireExplicitPolicy());
        }
        // (i.2)
        if ($ext->hasInhibitPolicyMapping() &&
             $ext->inhibitPolicyMapping() < $state->policyMapping()) {
            $state = $state->withPolicyMapping($ext->inhibitPolicyMapping());
        }
        return $state;
    }
private function _preparePolicyConstraints(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        $extensions = $cert->tbsCertificate()->extensions();
        if (!$extensions->hasPolicyConstraints()) {
            return $state;
        }
        $ext = $extensions->policyConstraints();
        // (i.1)
        if ($ext->hasRequireExplicitPolicy() &&
             $ext->requireExplicitPolicy() < $state->explicitPolicy()) {
            $state = $state->withExplicitPolicy($ext->requireExplicitPolicy());
        }
        // (i.2)
        if ($ext->hasInhibitPolicyMapping() &&
             $ext->inhibitPolicyMapping() < $state->policyMapping()) {
            $state = $state->withPolicyMapping($ext->inhibitPolicyMapping());
        }
        return $state;
    }
private function _preparePolicyConstraints ( ValidatorState $ state , Certificate $ cert ) : ValidatorState { $ extensions = $ cert -> tbsCertificate ( ) -> extensions ( ) ; if ( ! $ extensions -> hasPolicyConstraints ( ) ) { return $ state ; } $ ext = $ extensions -> policyConstraints ( ) ; // (i.1) if ( $ ext -> hasRequireExplicitPolicy ( ) && $ ext -> requireExplicitPolicy ( ) < $ state -> explicitPolicy ( ) ) { $ state = $ state -> withExplicitPolicy ( $ ext -> requireExplicitPolicy ( ) ) ; } // (i.2) if ( $ ext -> hasInhibitPolicyMapping ( ) && $ ext -> inhibitPolicyMapping ( ) < $ state -> policyMapping ( ) ) { $ state = $ state -> withPolicyMapping ( $ ext -> inhibitPolicyMapping ( ) ) ; } return $ state ; }
Apply policy constraints handling for the preparation step.

@param ValidatorState $state
@param Certificate $cert
@return ValidatorState
Apply policy constraints handling for the preparation step .