/** * * @see \X509\AttributeCertificate\AttCertIssuer::identifiesPKC() * @return bool */ public function identifiesPKC(Certificate $cert) { $name = $this->_issuerName->firstDN(); if (!$cert->tbsCertificate()->subject()->equals($name)) { return false; } return true; }
/** * Check whether any of the subject alternative names match entityName. * * @param GeneralNames $san * @return boolean */ private function _checkEntityAlternativeNames(GeneralNames $san) { // only directory names supported for now $name = $this->_entityName->firstDN(); foreach ($san->allOf(GeneralName::TAG_DIRECTORY_NAME) as $dn) { if ($dn instanceof DirectoryName && $dn->dn()->equals($name)) { return true; } } return false; }
/** * Check whether this IssuerSerial identifies given certificate. * * @param Certificate $cert * @return boolean */ public function identifiesPKC(Certificate $cert) { $tbs = $cert->tbsCertificate(); if (!$tbs->issuer()->equals($this->_issuer->firstDN())) { return false; } if (strval($tbs->serialNumber()) != strval($this->_serial)) { return false; } if ($this->_issuerUID && !$this->_checkUniqueID($cert)) { return false; } return true; }