public function processPolicies(ValidatorState $state, Certificate $cert): ValidatorState
    {
        $policies = $cert->tbsCertificate()
            ->extensions()
            ->certificatePolicies();
        $tree = clone $this;
        // (d.1) for each policy P not equal to anyPolicy
        foreach ($policies as $policy) {
            if ($policy->isAnyPolicy()) {
                $tree->_processAnyPolicy($policy, $cert, $state);
            } else {
                $tree->_processPolicy($policy, $state);
            }
        }
        // if whole tree is pruned
        if (!$tree->_pruneTree($state->index() - 1)) {
            return $state->withoutValidPolicyTree();
        }
        return $state->withValidPolicyTree($tree);
    }
public function processPolicies(ValidatorState $state, Certificate $cert): ValidatorState
    {
        $policies = $cert->tbsCertificate()
            ->extensions()
            ->certificatePolicies();
        $tree = clone $this;
        // (d.1) for each policy P not equal to anyPolicy
        foreach ($policies as $policy) {
            if ($policy->isAnyPolicy()) {
                $tree->_processAnyPolicy($policy, $cert, $state);
            } else {
                $tree->_processPolicy($policy, $state);
            }
        }
        // if whole tree is pruned
        if (!$tree->_pruneTree($state->index() - 1)) {
            return $state->withoutValidPolicyTree();
        }
        return $state->withValidPolicyTree($tree);
    }
public function processPolicies ( ValidatorState $ state , Certificate $ cert ) : ValidatorState { $ policies = $ cert -> tbsCertificate ( ) -> extensions ( ) -> certificatePolicies ( ) ; $ tree = clone $ this ; // (d.1) for each policy P not equal to anyPolicy foreach ( $ policies as $ policy ) { if ( $ policy -> isAnyPolicy ( ) ) { $ tree -> _processAnyPolicy ( $ policy , $ cert , $ state ) ; } else { $ tree -> _processPolicy ( $ policy , $ state ) ; } } // if whole tree is pruned if ( ! $ tree -> _pruneTree ( $ state -> index ( ) - 1 ) ) { return $ state -> withoutValidPolicyTree ( ) ; } return $ state -> withValidPolicyTree ( $ tree ) ; }
Process policy information from the certificate.

Certificate policies extension must be present.

@param ValidatorState $state
@param Certificate $cert
@return ValidatorState
Process policy information from the certificate .