public function createRSAPrivateKey()
    {
        $path = $this->getConfig()->getPrivateKeyFilePath();
        $this->createDir($path);
        $this->getConfig()->setPrivateKey((new RsaKeyGen())->createPrivateKey());

        if (@file_put_contents($path, $this->getConfig()->getPrivateKey()) === false) {
            throw new \Exception('Error when writing the RSA private key');
        }
    }