private function _preparePolicyMappings(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        $extensions = $cert->tbsCertificate()->extensions();
        if ($extensions->hasPolicyMappings()) {
            // (a) verify that anyPolicy mapping is not used
            if ($extensions->policyMappings()->hasAnyPolicyMapping()) {
                throw new PathValidationException("anyPolicy mapping found.");
            }
            // (b) process policy mappings
            if ($state->hasValidPolicyTree()) {
                $state = $state->validPolicyTree()->processMappings($state,
                    $cert);
            }
        }
        return $state;
    }
private function _preparePolicyMappings(ValidatorState $state,
        Certificate $cert): ValidatorState
    {
        $extensions = $cert->tbsCertificate()->extensions();
        if ($extensions->hasPolicyMappings()) {
            // (a) verify that anyPolicy mapping is not used
            if ($extensions->policyMappings()->hasAnyPolicyMapping()) {
                throw new PathValidationException("anyPolicy mapping found.");
            }
            // (b) process policy mappings
            if ($state->hasValidPolicyTree()) {
                $state = $state->validPolicyTree()->processMappings($state,
                    $cert);
            }
        }
        return $state;
    }
private function _preparePolicyMappings ( ValidatorState $ state , Certificate $ cert ) : ValidatorState { $ extensions = $ cert -> tbsCertificate ( ) -> extensions ( ) ; if ( $ extensions -> hasPolicyMappings ( ) ) { // (a) verify that anyPolicy mapping is not used if ( $ extensions -> policyMappings ( ) -> hasAnyPolicyMapping ( ) ) { throw new PathValidationException ( "anyPolicy mapping found." ) ; } // (b) process policy mappings if ( $ state -> hasValidPolicyTree ( ) ) { $ state = $ state -> validPolicyTree ( ) -> processMappings ( $ state , $ cert ) ; } } return $ state ; }
Apply policy mappings handling for the preparation step.

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