public function sign()
    {
        $this->crt = new SignedCertificate();

        $this->_altConfiguration();

        //print_r($this->altNames);

        /*
        print_r([
            $this->certConfigure, $this->domainName()->get()
        ]);
        */

        $this->crt->setPrivateKey($this->_generatePK());


        $privKey = $this->crt->getPrivateKey();
        $this->crt->setCsr(openssl_csr_new($this->domainName()->get(), $privKey, $this->certConfigure));

        if (!$this->caName == null) {
            // If CA name is not null sign certificate with loaded CA certificate
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), $this->_getCaCert(), $this->_getCaKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        } else {
            /**
             * Else self sign certificate
             * Its important for ROOT Certification authority certificate
             */
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), null, $this->crt->getPrivateKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        }

        return $this;
    }
public function sign()
    {
        $this->crt = new SignedCertificate();

        $this->_altConfiguration();

        //print_r($this->altNames);

        /*
        print_r([
            $this->certConfigure, $this->domainName()->get()
        ]);
        */

        $this->crt->setPrivateKey($this->_generatePK());


        $privKey = $this->crt->getPrivateKey();
        $this->crt->setCsr(openssl_csr_new($this->domainName()->get(), $privKey, $this->certConfigure));

        if (!$this->caName == null) {
            // If CA name is not null sign certificate with loaded CA certificate
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), $this->_getCaCert(), $this->_getCaKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        } else {
            /**
             * Else self sign certificate
             * Its important for ROOT Certification authority certificate
             */
            $this->crt->setSignedCert(openssl_csr_sign(
                $this->crt->getCsr(), null, $this->crt->getPrivateKey(), $this->_getConfig('daysvalid'), $this->certConfigure, time()
            ));
        }

        return $this;
    }
public function sign ( ) { $ this -> crt = new SignedCertificate ( ) ; $ this -> _altConfiguration ( ) ; //print_r($this->altNames); /*
        print_r([
            $this->certConfigure, $this->domainName()->get()
        ]);
        */ $ this -> crt -> setPrivateKey ( $ this -> _generatePK ( ) ) ; $ privKey = $ this -> crt -> getPrivateKey ( ) ; $ this -> crt -> setCsr ( openssl_csr_new ( $ this -> domainName ( ) -> get ( ) , $ privKey , $ this -> certConfigure ) ) ; if ( ! $ this -> caName == null ) { // If CA name is not null sign certificate with loaded CA certificate $ this -> crt -> setSignedCert ( openssl_csr_sign ( $ this -> crt -> getCsr ( ) , $ this -> _getCaCert ( ) , $ this -> _getCaKey ( ) , $ this -> _getConfig ( 'daysvalid' ) , $ this -> certConfigure , time ( ) ) ) ; } else { /**
             * Else self sign certificate
             * Its important for ROOT Certification authority certificate
             */ $ this -> crt -> setSignedCert ( openssl_csr_sign ( $ this -> crt -> getCsr ( ) , null , $ this -> crt -> getPrivateKey ( ) , $ this -> _getConfig ( 'daysvalid' ) , $ this -> certConfigure , time ( ) ) ) ; } return $ this ; }
Sign certificate file and export tem to disk
Sign certificate file and export tem to disk