HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: /var/www/html/punjabcabs/vendor/laravel/passport/src/Console/KeysCommand.php
<?php

namespace Laravel\Passport\Console;

use phpseclib\Crypt\RSA;
use Laravel\Passport\Passport;
use Illuminate\Console\Command;

class KeysCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'passport:keys';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create the encryption keys for API authentication';

    /**
     * Execute the console command.
     *
     * @param  RSA  $rsa
     * @return mixed
     */
    public function handle(RSA $rsa)
    {
        $keys = $rsa->createKey(4096);

        file_put_contents(Passport::keyPath('oauth-private.key'), array_get($keys, 'privatekey'));
        file_put_contents(Passport::keyPath('oauth-public.key'), array_get($keys, 'publickey'));

        $this->info('Encryption keys generated successfully.');
    }
}