Esempio n. 1
0
 /**
  * Process pathLenConstraint.
  *
  * @param ValidatorState $state
  * @param Certificate $cert
  * @return ValidatorState
  */
 private function _processPathLengthContraint(ValidatorState $state, Certificate $cert)
 {
     $extensions = $cert->tbsCertificate()->extensions();
     if ($extensions->hasBasicConstraints()) {
         $ext = $extensions->basicConstraints();
         if ($ext->hasPathLen()) {
             if ($ext->pathLen() < $state->maxPathLength()) {
                 $state = $state->withMaxPathLength($ext->pathLen());
             }
         }
     }
     return $state;
 }