@param \Platformsh\Client\Model\Certificate $cert
@param string                               $alias

@return string|bool
1756
protected function getCertificateIssuerByAlias(Certificate $cert, $alias) {
        foreach ($cert->issuer as $issuer) {
            if (isset($issuer['alias'], $issuer['value']) && $issuer['alias'] === $alias) {
                return $issuer['value'];
            }
        }

        return false;
    }
744159
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;
    }
238008
public function alias(string $alias): AliasInterface
    {
        if (!in_array($alias, $this->alias)) {
            $this->alias[] = $alias;
        }
        $this->aliasHelper($alias);

        return $this;
    }
377919
public function setAlias($alias)
    {
        if (!$this->isValidAlias($alias)) {
            return false;
        }

        $updateAliasStm = $this->connection->prepare("UPDATE Page SET alias = :alias WHERE page_id = :page_id");
        $updateAliasStm->bindParam(":alias", $this->alias);
        $updateAliasStm->bindParam(":page_id", $this->page_id);
        $this->alias = $alias;
        $updateAliasStm->execute();

        return true;
    }
744610
public function verifySignature(TokenRequest $tokenRequest, $certificate)
    {
        $result = openssl_verify(
            $tokenRequest->getIssuer() . ':' . $tokenRequest->getUsername(),
            base64_decode($tokenRequest->getSignature()),
            $certificate
        );

        return $result === 1 ? true : false;
    }
1021111
public function isHeldBy(Certificate $cert): bool
    {
        if (!$this->_acinfo->holder()->identifiesPKC($cert)) {
            return false;
        }
        return true;
    }
817850
public function load($alias)
    {
        if (array_key_exists($alias, $this->aliases)) {
            return class_alias($this->aliases[$alias], $alias);
        }

        return false;
    }
177248
public function getDomain($alias) {
		if (isset($this->aliases[$alias])) {
			return $this->aliases[$alias];
		}
		return $alias;
	}
774767
private function _checkUniqueID(Certificate $cert): bool
    {
        if (!$cert->tbsCertificate()->hasIssuerUniqueID()) {
            return false;
        }
        $uid = $cert->tbsCertificate()
            ->issuerUniqueID()
            ->string();
        if ($this->_issuerUID->string() != $uid) {
            return false;
        }
        return true;
    }
425885
public static function getAlias(string $alias): string
    {
        // empty OR not an alias
        if (!$alias || $alias[0] !== '@') {
            return $alias;
        }

        if (isset(self::$aliases[$alias])) {
            return self::$aliases[$alias];
        }

        list($root) = \explode('/', $alias, 2);
        if (!isset(self::$aliases[$root])) {
            throw new \InvalidArgumentException('The set root alias does not exist，alias=' . $root);
        }

        $rootPath  = self::$aliases[$root];
        $aliasPath = \str_replace($root, '', $alias);

        return $rootPath . $aliasPath;
    }
1298337
public function searchAlias( $alias, array $aliases = [] )
    {
        if ( isset( $aliases[ $alias ] ) )
        {
            $ttl = $aliases[ $alias ];
        }
        else if ( array_search( $alias, (array)$aliases ) !== false )
        {
            $ttl = 3600;
        }
        else
        {
            return false;
        }

        return $ttl;
    }
1079800
public function resolveNamespaceAlias(string $alias)
    {
        foreach ($this->namespaces as $namespace) {
            list($className, $aliasTo) = $namespace;

            if (false == strpos($alias, $aliasTo)) {
                if (!empty($aliasTo)) {
                    $alias = substr($alias, strlen($aliasTo) + 1);
                }

                return $this->getClassForNamespaceAlias($className.'\\'.$alias);
            }
        }

        return false;
    }
1149358
private function _hasEqualPublicKey(Certificate $cert): bool
    {
        $kid1 = $this->_tbsCertificate->subjectPublicKeyInfo()->keyIdentifier();
        $kid2 = $cert->_tbsCertificate->subjectPublicKeyInfo()->keyIdentifier();
        return $kid1 == $kid2;
    }
1071220
public function getFileName($alias)
	{
		$n = dirname($alias);
		$path = $this->path;
		if ('.' !== $n)
		{
			$path .= $n . DIRECTORY_SEPARATOR;
		}
		if (! is_dir($path))
		{
			mkdir($path, 0755, true);
		}
		return $path . md5(basename($alias)) . $this->ext;
	}
1007300
public function getTableForAlias($alias)
    {
        if (isset($this->aliases[$alias])) {
            return $this->aliases[$alias];
        }

        return null;
    }
765927
public function andLevelEquals($level, $alias = null)
    {
        list($alias, $suffix) = $this->getAliasAndSuffix($alias);

        return $this->andWhere($alias.'._level = :level'.$suffix)
                        ->setParameter('level'.$suffix, $level);
    }
183613
@Override
	public void engineSetCertificateEntry(String alias, Certificate certificate)
			throws KeyStoreException {

		if (!(certificate instanceof X509Certificate)) {
			throw new KeyStoreException(
					"Certificate must be instance of X509Certificate");
		}
		File file;
		ResourceTrustAnchor trustAnchor = getCertificateEntry(alias);
		if (trustAnchor != null) {
			file = trustAnchor.getFile();
		} else {
			file = new File(defaultDirectory, alias);
		}
		X509Certificate x509Cert = (X509Certificate) certificate;
		try {
			if(!inMemoryOnly){
				writeCertificate(x509Cert, file);
			}
			ResourceTrustAnchor anchor = new ResourceTrustAnchor(inMemoryOnly,
					new GlobusResource(file.getAbsolutePath()), new TrustAnchor(x509Cert,
							null));
			this.aliasObjectMap.put(alias, anchor);
			this.certFilenameMap.put(x509Cert, alias);
		} catch (ResourceStoreException e) {
			throw new KeyStoreException(e);
		} catch (IOException e) {
			throw new KeyStoreException(e);
		} catch (CertificateEncodingException e) {
			throw new KeyStoreException(e);
		}
	}