/** * * @see \X509\AttributeCertificate\AttCertIssuer::ASN1() * @return ImplicitlyTaggedType Tagged Sequence */ public function toASN1() { $elements = array(); if (isset($this->_issuerName)) { $elements[] = $this->_issuerName->toASN1(); } if (isset($this->_baseCertificateID)) { $elements[] = new ImplicitlyTaggedType(0, $this->_baseCertificateID->toASN1()); } if (isset($this->_objectDigestInfo)) { $elements[] = new ImplicitlyTaggedType(1, $this->_objectDigestInfo->toASN1()); } return new ImplicitlyTaggedType(0, new Sequence(...$elements)); }
/** * Check whether Holder identifies given certificate. * * @param Certificate $cert * @return boolean */ public function identifiesPKC(Certificate $cert) { // if neither baseCertificateID nor entityName are present if (!$this->_baseCertificateID && !$this->_entityName) { return false; } // if baseCertificateID is present, but doesn't match if ($this->_baseCertificateID && !$this->_baseCertificateID->identifiesPKC($cert)) { return false; } // if entityName is present, but doesn't match if ($this->_entityName && !$this->_checkEntityName($cert)) { return false; } return true; }