Create a new RSA key instance.

@param array $auth

@return \Crypt_RSA
483703
protected function getKey(array $auth)
    {
        with($key = $this->getNewKey())->setPassword(array_get($auth, 'keyphrase'));

        return $key;
    }
1007813
public function authenticate($auth = null)
    {
        if ($auth !== null) {
            $this->auth = $auth;
        }

        return $this->auth;
    }
630126
public function setAuth($auth)
    {
        $auth = strtolower($auth);

        if (!in_array($auth, [self::AUTHENTICATION_METHOD_OAUTH])) {
            throw new \InvalidArgumentException('Parameter "auth" must be filled and valid');
        }

        $this->auth = $auth;
        return $this;
    }
657005
protected function getClient(array $auth): Pusher
    {
        return new Pusher(
            $auth['auth_key'],
            $auth['secret'],
            $auth['app_id'],
            $auth['options'],
            $auth['host'],
            $auth['port'],
            $auth['timeout']
        );
    }
1155486
public function setAuth(Zend_Amf_Auth_Abstract $auth)
    {
        $this->_auth = $auth;
        if ((null === $this->getAcl()) && method_exists($auth, 'getAcl')) {
            $this->setAcl($auth->getAcl());
        }
        return $this;
    }
967383
public function create(array $data)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::create($data);
    }
1089990
public static function decodeCredentials($token, $auth) {
        try {
            return JWT::decode($token, $auth['key'], array('HS256'));
        } catch (SignatureInvalidException $e) {
            abortAuth(SignatureInvalidException::class);
        } catch (ExpiredException $e) {
            abortAuth(ExpiredException::class);
        }
    }
839445
public function with(array $auth, array $api_url = null)
    {
        $api_url = $api_url ?: config('livecoin.url');
        $this->client = new Client($auth, $api_url);
        return $this;
    }
368011
public function generateKey(array $options = [])
	{
		// Generate the encryption key.
		try
		{
			$public = DefuseKey::createNewRandomKey();
		}
		catch (EnvironmentIsBrokenException $ex)
		{
			throw new \RuntimeException('Cannot safely create a key', $ex->getCode(), $ex);
		}

		// Create the new encryption key object.
		return new Key('crypto', $public->saveToAsciiSafeString(), $public->getRawBytes());
	}
398797
public function addAuth(array $auth, $validate = false)
    {
        $response = $this->getUser()->post(
            'source/auth/add',
            array('id' => $this->getId(), 'auth' => $auth, 'validate' => $validate)
        );

        $this->auth = $response['auth'];
    }
1173633
public function create(array $credentials)
	{
		$user = $this->createModel();
		$user->fill($credentials);
		$user->save();

		return $user;
	}
1108012
public static function fromArrayToRSACrypt(array $data)
    {
        $xml = self::fromArrayToXML($data);
        $rsa = new RSA();
        $rsa->loadKey($xml);

        return $rsa;
    }
180486
public function create($providerKey, array $attributes, $user, SamlSpResponseToken $responseToken)
    {
        $token = new SamlSpToken(
            $user instanceof UserInterface ? $user->getRoles() : [],
            $providerKey,
            $attributes,
            $user
        );

        return $token;
    }
222494
public function make($class, $hostname, $user, $password, $port = 22, $fingerprint = null)
    {
        if ($class === Ssh2SftpConnectionInterface::class) {
            $class = $this->getDefaultConnectionClass();
        }

        return new $class($hostname, $user, $password, $port, $fingerprint, app('files'));
    }
11167
public function privateKeyToDer($privateKey, $privateKyePassword = '')
    {
        try {
            if (strlen($privateKyePassword) === 0) {
                return CryptoVirgilKeyPair::privateKeyToDER($privateKey);
            }

            return CryptoVirgilKeyPair::privateKeyToDER(
                $this->encryptPrivateKey($privateKey, $privateKyePassword),
                $privateKyePassword
            );
        } catch (Exception $exception) {
            throw new PrivateKeyToDerConvertingException($exception->getMessage(), $exception->getCode());
        }
    }
593748
protected function parseAuthenticationConfiguration(array $auth): array
    {
        $driver = $auth['defaults']['guard'] ?? null;

        $guard = $auth['guards'][$driver] ?? [
            'driver' => 'session',
            'provider' => 'users',
        ];

        $provider = $auth['providers'][$guard['provider']] ?? [
            'driver' => 'eloquent',
            'model' => User::class,
        ];

        return \compact('guard', 'provider');
    }
1019590
public function create_key() {
        $res = openssl_pkey_new($this->config);
        if($res == false) return false;
        openssl_pkey_export($res, $privKey, null, $this->config);
        $public_key = openssl_pkey_get_details($res);

        $this->privKey=$privKey;
        $this->pubKey=$public_key["key"];
        openssl_free_key($res);
        return array('public_key'=>$public_key["key"],'private_key'=>$privKey);
    }