Get public key.

@throws \RuntimeException
@return PublicKey
764429
public function publicKey(): PublicKey
    {
        $algo = $this->algorithmIdentifier();
        switch ($algo->oid()) {
            // RSA
            case AlgorithmIdentifier::OID_RSA_ENCRYPTION:
                return RSA\RSAPublicKey::fromDER($this->_publicKeyData);
            // elliptic curve
            case AlgorithmIdentifier::OID_EC_PUBLIC_KEY:
                if (!$algo instanceof ECPublicKeyAlgorithmIdentifier) {
                    throw new \UnexpectedValueException("Not an EC algorithm.");
                }
                // ECPoint is directly mapped into public key data
                return new EC\ECPublicKey($this->_publicKeyData,
                    $algo->namedCurve());
        }
        throw new \RuntimeException(
            "Public key " . $algo->name() . " not supported.");
    }
442092
public function getRsaPublicKey()
    {
        if ($this->rsaPublicKey) {
            return $this->rsaPublicKey;
        }

        if (!file_exists($this->rsaPublicKeyFile)) {
            throw new CredentialsException('Could not read the public key file.');
        }

        $this->rsaPublicKey = openssl_get_publickey(file_get_contents($this->rsaPublicKeyFile));

        if (!$this->rsaPublicKey) {
            throw new CredentialsException('Cannot access public key for signing');
        }

        return $this->rsaPublicKey;
    }
1216842
protected function getPrivateKey()
    {
        try {
            $privateKey = file_get_contents($this->privateKeyPath);
        } catch (\Exception $e) {
            $msg = 'Impossible to read the private key of the DKIM swiftmailer signer "%s"';

            throw new RuntimeException(sprintf($msg, $this->privateKeyPath));
        }

        return $privateKey;
    }
1079768
public function get($key)
	{
		$file = $this->path($key);

		if (!file_exists($file))
		{
			return null;
		}

		$data = @unserialize(file_get_contents($file));

		if (!$data)
		{
			throw new RuntimeException('Cache file is invalid.');
		}

		if ($this->isDataExpired($data))
		{
			$this->forget($key);
			return null;
		}

		return $data['value'];
	}
432598
public function getPrimaryKeyValue()
    {
        //
        $key = static::getPrimaryKey();

        //
        return $key
            && isset($this->{$key})
            ? $this->{$key}
            : null;
    }
147183
public function getUserInfo() {
        $userInfo = $this->getCommand('GetUserInfo', array(
            'user' => $this->getUser(),
        ))->execute();

        return PublicKeyFallback::fallback($userInfo);
    }
249722
public function getPath()
    {
        if (!$this->php_path) {
            if (!($this->php_path = $this->finder->find())) {
                throw new \RuntimeException(
                    'The php executable could not be found, add it to your PATH environment variable and try again'
                );
            }
            $this->php_path = escapeshellarg($this->php_path);
        }

        return $this->php_path;
    }
729302
public function getPrimaryKey() {
        if ($this->primaryKey === null) {
            $schema = $this->getSchema();

            $pk = [];
            foreach ($schema->getSchemaArray()['properties'] as $column => $property) {
                if (!empty($property['primary'])) {
                    $pk[] = $column;
                }
            }
            $this->primaryKey = $pk;
        }
        return $this->primaryKey;
    }
583241
public function getKey()
    {
        if (Str::startsWith($this->key, 'base64:')) {
            return base64_decode(substr($this->key, 7));
        }

        return $this->key;
    }
990417
public function getPublicKey()
    {
        /** @var string $cacheKey */
        if(empty($this->_publicKey) && !empty($this->jwkUrl))
        {
            if(Yii::$app->cache)
            {
                $cacheKey = "JWK_".sha1($this->jwkUrl);
                $jwk = Yii::$app->cache->get($cacheKey);
            }

            if(empty($jwk))
            {
                $res = $this->createRequest()
                    ->setMethod('GET')
                    ->setUrl($this->jwkUrl)
                    ->send();
                if(!empty($res)) {
                    $jwk = $res->getContent();
                    if(!empty($jwk) && Yii::$app->cache)
                        Yii::$app->cache->set($cacheKey, $jwk, self::PUBLIC_KEY_EXPIRE_DURATION);
                } else {
                    throw new UnauthorizedHttpException("Can\'t get public key");
                }
            }
            if(!empty($jwk))
                $this->_publicKey = JWK::parseKeySet($jwk);
        }
        return $this->_publicKey;
    }
689552
public function getPrimaryKey()
    {
        if ($this->_primaryKey === null) {
            $key = (array)$this->getSchema()->primaryKey();
            if (count($key) === 1) {
                $key = $key[0];
            }
            $this->_primaryKey = $key;
        }

        return $this->_primaryKey;
    }
66341
public function getRouteKey()
    {
        $key = $this->getKey();

        if ($this->getKeyType() === 'int' && (ctype_digit($key) || is_int($key))) {
            return App::make('fakeid')->encode((int) $key);
        }

        throw new RuntimeException('Key should be of type int to encode into a fake id.');
    }
746075
public function getPrimaryKey()
    {
        $columns = $this->getColumns();

        if (!isset($columns)) {
            throw new DatabaseException('Column schema not found!');
        }

        if (count($columns) > 0) {
            $primaryKey = null;
            foreach ($columns as $key => $value) {
                if ($value['COLUMN_KEY'] == 'PRI' || $value['EXTRA'] == 'auto_increment') {
                    $primaryKey = $value['COLUMN_NAME'];
                    break;
                }
            }
        }

        return $primaryKey;
    }
301525
protected function getEncrypter() : IEncrypter
    {
        $encodedEncryptionKey = getenv('ENCRYPTION_KEY');

        if ($encodedEncryptionKey === null) {
            throw new RuntimeException('"ENCRYPTION_KEY" value not set in environment.  Check that you have it set in an environment config file such as ".env.app.php".  Note:  ".env.example.php" is only a template for environment config files - it is not actually used.');
        }

        $decodedEncryptionKey = \hex2bin($encodedEncryptionKey);

        if (\mb_strlen($decodedEncryptionKey, '8bit') < 32) {
            throw new RuntimeException('The minimum length encryption key has been upgraded from 16 bytes to 32 bytes.  Please re-run "php apex encryption:generatekey" to create a new, suitably-long encryption key.');
        }

        return new Encrypter(new Key($decodedEncryptionKey));
    }
1114939
public function key()
    {
        // TODO: Track position internally to avoid repeated info() calls
        if ( ! $this->useIdentifierKeys) {
            $info = $this->riakCursor->info();

            return isset($info['at']) ? $info['at'] : null;
        }

        return $this->riakCursor->key();
    }
724744
protected function key()
    {
        $key = rawurlencode($this->clientCredentials->getSecret()).'&';

        if ($this->credentials !== null) {
            $key .= rawurlencode($this->credentials->getSecret());
        }

        return $key;
    }
382232
public function get($key)
    {
        $key = strtolower($key);

        if (! array_key_exists($key, $this->benchmarks))
        {
            throw new \RuntimeException('No Benchmark exists for: '. $key);
        }

        return $this->benchmarks[$key];
    }