Find all issuers of the target certificate from a given bundle.

@param Certificate $target Target certificate
@param CertificateBundle $bundle Certificates to search
@return Certificate[]
499829
protected function _findIssuers(Certificate $target,
        CertificateBundle $bundle): array
    {
        $issuers = array();
        $issuer_name = $target->tbsCertificate()->issuer();
        $extensions = $target->tbsCertificate()->extensions();
        // find by authority key identifier
        if ($extensions->hasAuthorityKeyIdentifier()) {
            $ext = $extensions->authorityKeyIdentifier();
            if ($ext->hasKeyIdentifier()) {
                foreach ($bundle->allBySubjectKeyIdentifier(
                    $ext->keyIdentifier()) as $issuer) {
                    // check that issuer name matches
                    if ($issuer->tbsCertificate()
                        ->subject()
                        ->equals($issuer_name)) {
                        $issuers[] = $issuer;
                    }
                }
            }
        }
        return $issuers;
    }
695408
public function getCertificatesAsArray()
    {
        // Iterate over certificates nodes and convert to an array
        $certificates = array();
        /** @var \AppserverIo\Appserver\Core\Api\Node\CertificateNode $certificateNode */
        foreach ($this->getCertificates() as $certificateNode) {
            // restructure to an array
            $certificates[] = array(
                'domain' => $certificateNode->getDomain(),
                'certPath' => $certificateNode->getCertPath()
            );
        }

        // return certificates array
        return $certificates;
    }
662291
public function getIssuers()
    {
        $result = array();

        foreach ($this->data->issuers->issuer as $issuer) {
            $result[(string) $issuer->code] = (string) $issuer->description;
        }

        return $result;
    }
681592
public function getIssuers()
    {
        $issuers = array();

        foreach ($this->data['data'] as $issuer) {
            $issuers[] = new Issuer(
                $issuer['code'],
                $issuer['description']
            );
        }

        return $issuers;
    }
1038631
private function encodeBundle(ResourceBundleInterface $bundle): array
    {
        $encodedBundle = [];
        foreach ($bundle->getKeys() as $key) {
            $encodedBundle[$key] = $this->getBundleValue($bundle, (string)$key);
        }

        return $encodedBundle;
    }
970020
public function queueIndexingJob(string $target): array
    {
        return $this->getApi()->request(sprintf('/staff/indexing_jobs'), Request::METHOD_POST, [
                'target' => $target
            ]);
    }
773918
public function getCert(string $type): array
    {
        $type = mb_strtolower($type);
        $this->throwIfNotInArray($type, self::CERTS);
        return $this->_certs[$type] ?? [];
    }
733072
protected function getRequiredServiceBundleCodeGenerators($bundle)
    {
        return [
            $this->createServiceCodeGenerator($bundle),
            $this->createServiceInterfaceCodeGenerator($bundle),
            $this->createServiceFactoryCodeGenerator($bundle),
        ];
    }
775157
private function getTargetParamsFromTarget( $target ) {
		if( $target instanceof EntityId ) {
			return array( 'id' => $target->getSerialization() );
		} elseif( $target instanceof SiteLink ) {
			return array(
				'site' => $target->getSiteId(),
				'title' => $target->getPageName(),
			);
		} else {
			throw new UnexpectedValueException( '$target needs to be an EntityId or SiteLink' );
		}
	}
873598
public static function loadBundle(&$bundle)
    {
        if (sizeof($bundle->content) == 0) {
            return;
        }
        
        // check for cached, preloaded bundle
        $bundleCache = Cache::getInstance('MEMCACHE', 'APC', 'FILE_ENCODED');
        $bundleCachePath = "xqbundle/{$bundle->bundleId}";
        
        if (!DEBUG && ($bundleCache->available() && $bundleCache->hasCached($bundleCachePath))) {
            $bundle = $bundleCache->getCached($bundleCachePath);
            return;
        }
        
        // preload
        $bundle->lastModified = null;
        $bundle->files = array();
        
        $fileNames = array();
        foreach ($bundle->content as $file) {
            $preloaded = self::getBundleFileDetails($bundle, $file);
            
            $bundle->files[] = $preloaded;
            $fileNames[] = $preloaded->path;
        }
        
        $bundle->contentType = self::getBundleContentType($bundle);
        $bundle->tag = md5($bundle->lastModified . $bundle->bundleId . implode('-', $fileNames));
        
        $bundle->output = self::getBundleContent($bundle);
        
        if (!DEBUG && $bundleCache->available()) {
            $bundleCache->cache($bundleCachePath, $bundle);
        }
    }
785250
public static function get(string $target)
    {
        if (!self::has($target)) {
            return null;
        }

        if (!isset(self::$unserialized[$target])) {
            self::$unserialized[$target] = unserialize(self::$annotations[$target]);
        }

        return self::$unserialized[$target];
    }
111864
private function bundlesFromConfiguration(): array
    {
        $bundles = [];

        /** @var string[] $packageBundles */
        foreach ($this->readBundleConfiguration() as $packageBundles) {
            foreach ($packageBundles as $bundleClassName) {
                if (class_exists($bundleClassName)) {
                    $bundles[] = new $bundleClassName();
                }
            }
        }

        return $bundles;
    }
783918
@SuppressWarnings("unchecked")
    public List<CertificateMeta> parse() throws CertificateException {
        CMSSignedData cmsSignedData;
        try {
            cmsSignedData = new CMSSignedData(data);
        } catch (CMSException e) {
            throw new CertificateException(e);
        }
        Store<X509CertificateHolder> certStore = cmsSignedData.getCertificates();
        SignerInformationStore signerInfos = cmsSignedData.getSignerInfos();
        Collection<SignerInformation> signers = signerInfos.getSigners();
        List<X509Certificate> certificates = new ArrayList<>();
        for (SignerInformation signer : signers) {
            Collection<X509CertificateHolder> matches = certStore.getMatches(signer.getSID());
            for (X509CertificateHolder holder : matches) {
                certificates.add(new JcaX509CertificateConverter().setProvider(provider).getCertificate(holder));
            }
        }
        return CertificateMetas.from(certificates);
    }
387435
private static function getSignatures($header, $scheme)
    {
        $signatures = [];
        $items = explode(",", $header);

        foreach ($items as $item) {
            $itemParts = explode("=", $item, 2);
            if ($itemParts[0] == $scheme) {
                array_push($signatures, $itemParts[1]);
            }
        }

        return $signatures;
    }
413598
public static function getByPattern(array $bundles, $pattern)
    {
        $pattern = trim($pattern, '/');
        $items = [];
        foreach ($bundles as $bundle) {
            /**
             * @var $bundle RouteBundle
             */
            if ($bundle->getPattern() == $pattern) {
                $items = $bundle;
            }
        }
        return $items;
    }
303545
public Certificate[] getCertificates() {
        // getCodeSigners() does the sec check
        final CodeSigner[] codeSigners = getCodeSigners();
        if (codeSigners == null) {
            return null;
        }
        final List<Certificate> certList = new ArrayList<Certificate>(codeSigners.length * 3);
        for (CodeSigner signer : codeSigners) {
            certList.addAll(signer.getSignerCertPath().getCertificates());
        }
        return certList.toArray(new Certificate[certList.size()]);
    }
1074952
public function getNewBundles()
    {
        $bundles = $this->bundleLocatorService->getAvailableBundles();
        $newBundles = [];

        foreach ($bundles as $bundle) {
            // Check whether this bundle has already been installed
            switch ($this->isRegisteredBundle($bundle)) {
                case Installer::STATUS_REGISTERED_NO:
                    $bundle->setStatus(Installer::STATUS_REGISTERED_NO);
                    $newBundles[] = $bundle;
                    break;

                case Installer::STATUS_REGISTERED_OLDER:
                    // Get the existing bundle.
                    /** @var Bundle $registeredBundle */
                    $registeredBundle = $this->em
                        ->getRepository('CampaignChainCoreBundle:Bundle')
                        ->findOneByName($bundle->getName());
                    // Update the existing bundle's data.
                    $registeredBundle->setType($bundle->getType());
                    $registeredBundle->setDescription($bundle->getDescription());
                    $registeredBundle->setLicense($bundle->getLicense());
                    $registeredBundle->setAuthors($bundle->getAuthors());
                    $registeredBundle->setHomepage($bundle->getHomepage());
                    $registeredBundle->setVersion($bundle->getVersion());
                    $registeredBundle->setExtra($bundle->getExtra());

                    $registeredBundle->setStatus(Installer::STATUS_REGISTERED_OLDER);
                    $newBundles[] = $registeredBundle;
                    break;

                case Installer::STATUS_REGISTERED_SAME:
                    $bundle->setStatus(Installer::STATUS_REGISTERED_SAME);
                    break;
            }
        }

        return $newBundles;
    }