Cli/Key.php
private function createKeys()
    {
        //Create Can Keys
        shuffle(Devbr\Can::$base);
        shuffle(Devbr\Can::$extra_base);
        file_put_contents($this->configKeyPath.'can.key', implode(Devbr\Can::$base)."\n".implode(Devbr\Can::$extra_base));

        $SSLcnf = [];
        $dn = [];

        //get configurations
        include $this->configKeyPath.'openssl.config.php';

        // Generate a new private (and public) key pair
        $privkey = openssl_pkey_new($SSLcnf);

        // Generate a certificate signing request
        $csr = openssl_csr_new($dn, $privkey, $SSLcnf);

        // You will usually want to create a self-signed certificate at this
        // point until your CA fulfills your request.
        // This creates a self-signed cert that is valid for 365 days
        $sscert = openssl_csr_sign($csr, null, $privkey, 365, $SSLcnf);

        //CERTIFICADO
        openssl_csr_export_to_file($csr, $this->configKeyPath.'certificate.crt', false);

        //CERTIFICADO AUTO-ASSINADO
        openssl_x509_export_to_file($sscert, $this->configKeyPath.'self_signed_certificate.cer', false);

        //CHAVE PRIVADA (private.pem)
        openssl_pkey_export_to_file($privkey, $this->configKeyPath.'private.key', null, $SSLcnf);

        //CHAVE PÚBLICA (public.key)
        file_put_contents($this->configKeyPath.'public.key', openssl_pkey_get_details($privkey)['key']);
    }
private function createKeys()
    {
        //Create Can Keys
        shuffle(Devbr\Can::$base);
        shuffle(Devbr\Can::$extra_base);
        file_put_contents($this->configKeyPath.'can.key', implode(Devbr\Can::$base)."\n".implode(Devbr\Can::$extra_base));

        $SSLcnf = [];
        $dn = [];

        //get configurations
        include $this->configKeyPath.'openssl.config.php';

        // Generate a new private (and public) key pair
        $privkey = openssl_pkey_new($SSLcnf);

        // Generate a certificate signing request
        $csr = openssl_csr_new($dn, $privkey, $SSLcnf);

        // You will usually want to create a self-signed certificate at this
        // point until your CA fulfills your request.
        // This creates a self-signed cert that is valid for 365 days
        $sscert = openssl_csr_sign($csr, null, $privkey, 365, $SSLcnf);

        //CERTIFICADO
        openssl_csr_export_to_file($csr, $this->configKeyPath.'certificate.crt', false);

        //CERTIFICADO AUTO-ASSINADO
        openssl_x509_export_to_file($sscert, $this->configKeyPath.'self_signed_certificate.cer', false);

        //CHAVE PRIVADA (private.pem)
        openssl_pkey_export_to_file($privkey, $this->configKeyPath.'private.key', null, $SSLcnf);

        //CHAVE PÚBLICA (public.key)
        file_put_contents($this->configKeyPath.'public.key', openssl_pkey_get_details($privkey)['key']);
    }
private function createKeys ( ) { //Create Can Keys shuffle ( Devbr \ Can :: $ base ) ; shuffle ( Devbr \ Can :: $ extra_base ) ; file_put_contents ( $ this -> configKeyPath . 'can.key' , implode ( Devbr \ Can :: $ base ) . "\n" . implode ( Devbr \ Can :: $ extra_base ) ) ; $ SSLcnf = [ ] ; $ dn = [ ] ; //get configurations include $ this -> configKeyPath . 'openssl.config.php' ; // Generate a new private (and public) key pair $ privkey = openssl_pkey_new ( $ SSLcnf ) ; // Generate a certificate signing request $ csr = openssl_csr_new ( $ dn , $ privkey , $ SSLcnf ) ; // You will usually want to create a self-signed certificate at this // point until your CA fulfills your request. // This creates a self-signed cert that is valid for 365 days $ sscert = openssl_csr_sign ( $ csr , null , $ privkey , 365 , $ SSLcnf ) ; //CERTIFICADO openssl_csr_export_to_file ( $ csr , $ this -> configKeyPath . 'certificate.crt' , false ) ; //CERTIFICADO AUTO-ASSINADO openssl_x509_export_to_file ( $ sscert , $ this -> configKeyPath . 'self_signed_certificate.cer' , false ) ; //CHAVE PRIVADA (private.pem) openssl_pkey_export_to_file ( $ privkey , $ this -> configKeyPath . 'private.key' , null , $ SSLcnf ) ; //CHAVE PÚBLICA (public.key) file_put_contents ( $ this -> configKeyPath . 'public.key' , openssl_pkey_get_details ( $ privkey ) [ 'key' ] ) ; }
Create Can anda SSL keys

@return void none
Create Can anda SSL keys