private function _checkEntityName(Certificate $cert): bool
    {
        $name = $this->_entityName->firstDN();
        if ($cert->tbsCertificate()
            ->subject()
            ->equals($name)) {
            return true;
        }
        $exts = $cert->tbsCertificate()->extensions();
        if ($exts->hasSubjectAlternativeName()) {
            $ext = $exts->subjectAlternativeName();
            if ($this->_checkEntityAlternativeNames($ext->names())) {
                return true;
            }
        }
        return false;
    }
private function _checkEntityName(Certificate $cert): bool
    {
        $name = $this->_entityName->firstDN();
        if ($cert->tbsCertificate()
            ->subject()
            ->equals($name)) {
            return true;
        }
        $exts = $cert->tbsCertificate()->extensions();
        if ($exts->hasSubjectAlternativeName()) {
            $ext = $exts->subjectAlternativeName();
            if ($this->_checkEntityAlternativeNames($ext->names())) {
                return true;
            }
        }
        return false;
    }
private function _checkEntityName ( Certificate $ cert ) : bool { $ name = $ this -> _entityName -> firstDN ( ) ; if ( $ cert -> tbsCertificate ( ) -> subject ( ) -> equals ( $ name ) ) { return true ; } $ exts = $ cert -> tbsCertificate ( ) -> extensions ( ) ; if ( $ exts -> hasSubjectAlternativeName ( ) ) { $ ext = $ exts -> subjectAlternativeName ( ) ; if ( $ this -> _checkEntityAlternativeNames ( $ ext -> names ( ) ) ) { return true ; } } return false ; }
Check whether entityName matches the given certificate.

@param Certificate $cert
@return boolean
Check whether entityName matches the given certificate .