protected static function setOpenSSLSignature(\Phar $phar, $pathAlias)
    {
        $path = \Yii::getAlias($pathAlias);
        if (file_exists($path) === false) {
            throw new InvalidConfigException("Invalid configuration. Private key '{$path}' does not exists.");
        }

        $pemFile = file_get_contents($path);

        $resource = openssl_get_privatekey($pemFile);
        $privateKey = '';
        openssl_pkey_export($resource, $privateKey);
        $phar->setSignatureAlgorithm(\Phar::OPENSSL, $privateKey);
    }