示例#1
0
文件: V2Form.php 项目: sop/x509
 /**
  *
  * @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;
 }
示例#2
0
文件: Holder.php 项目: sop/x509
 /**
  * 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;
 }
示例#3
0
文件: IssuerSerial.php 项目: sop/x509
 /**
  * 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;
 }