{"id":21038387,"url":"https://github.com/dudacgf/genkeycsr","last_synced_at":"2026-05-18T22:15:29.021Z","repository":{"id":155319768,"uuid":"436433629","full_name":"dudacgf/genkeycsr","owner":"dudacgf","description":"Genkeycsr is a micro python Flask webpage that helps generating private keys and certificate signing requests.","archived":false,"fork":false,"pushed_at":"2024-07-09T22:25:44.000Z","size":2319,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T16:26:44.760Z","etag":null,"topics":["certificate-signing-request","criptography","flask","private-key","python36","python39","wsgi-application"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dudacgf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-09T00:28:28.000Z","updated_at":"2022-12-17T12:01:10.000Z","dependencies_parsed_at":"2025-01-20T16:51:30.977Z","dependency_job_id":null,"html_url":"https://github.com/dudacgf/genkeycsr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudacgf%2Fgenkeycsr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudacgf%2Fgenkeycsr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudacgf%2Fgenkeycsr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dudacgf%2Fgenkeycsr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dudacgf","download_url":"https://codeload.github.com/dudacgf/genkeycsr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243482848,"owners_count":20297897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["certificate-signing-request","criptography","flask","private-key","python36","python39","wsgi-application"],"created_at":"2024-11-19T13:31:50.999Z","updated_at":"2026-05-18T22:15:28.977Z","avatar_url":"https://github.com/dudacgf.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub](https://img.shields.io/github/license/dudacgf/genkeycsr)\n[![CodeQL](https://github.com/dudacgf/genkeycsr/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/dudacgf/genkeycsr/actions/workflows/codeql-analysis.yml)\n![Snyk](https://snyk-widget.herokuapp.com/badge/pip/dudacgf/genkeycsr/badge.svg)\n![Lines of code](https://img.shields.io/tokei/lines/github/dudacgf/genkeycsr)\n![Shields.io](https://img.shields.io/badge/%20Just%20-%20Relax%20-blue)\n\n# Genkeycsr\nGenkeycsr is a Python Flask micro webpage that helps generating private keys and certificate signing requests. It is intended to be used as a helper to in premises root CA structures that cannot be served by letsencrypt or other commercial certificate authorities. It offers an option to create a self-signed certificate along with the private key but you should not use self-signed certificates and so, this options is considered for emergency use only and therefore issues a certificate valid only for 10 days.\n\nGenkeycsr is just a wrapper around the code found in the tutorial of [pica/cryptography](https://cryptography.io/en/latest/x509/tutorial/) and only adapts it to its use. \n\nIt has been tested and run as a standalone site or under apache/wsgi in Ubuntu 20.04+, RedHat/Centos 7/8. But I believe it can be run under nginx or lighthttpd or any other http server that supports wsgi.\n\n________________\n## Installation\n    Install python and pip and virtualenvironment\n    Ubuntu\n    # sudo apt-get install python3 python3-pip python3-virtualenv\n    RedHat/CentOS 7\n    # sudo yum install python3 python3-pip python3-venv\n    Under RedHat/CentOS/Rocky 8 you may (you should) install python 3.9\n    # sudo yum install python3.9 python3.9-pip python3.9-virtualenv\n\n    Clone the repository\n    # cd /srv\n    # sudo git clone https://github.com/dudacgf/genkeycsr\n\n    __su__ to root to create the python isolated environment\n    # sudo su -l\n    $ cd /srv/genkeycsr\n    $ python3 -m venv .env\n    $ . .env/bin/activate\n    (.env) $ which pip3\n    /srvp3 v/genkeycsr/.env/bin/pip3       _*[OK]*_\n    (.env) $ pip3 install pip setuptools wheel build --upgrade\n    (.env) $ pip3 install -r requirements.txt\n\n    Now, test the site and point your browser to server:5000\n    (.env) $ ./run.py\n\n   ![Site Page Image](./docs/images/genkeycsr\\_default_page.png)\n\n\n    After the isolated environment is installed, you can run the page as a normal user:\n    # cd /srv/genkeycsr\n    # . .env/bin/activate\n    # ./run.py\n\n_________________\n## Configuration\n\n### Default Attributes\n\nYou can change the default attributes presented when the page is first loaded. There is a file docs/sample\\_config.py that you can copy anywhere in your system and adapt it. Use it via GENKEYCSR\\_CONFIG\\_PATH environment variable:\n\n\n~~~python\n# private key size\nGENKEYCSR_KEY_SIZE=2048 \n\n# certificate attributes\nGENKEYCSR_COUNTRY='GK'\nGENKEYCSR_STATE='GenKey DC'\nGENKEYCSR_LOCALITY=''\nGENKEYCSR_ORGNAME='Genkey District Hall'\nGENKEYCSR_COMMON_NAME='CHANGE-ME.genkey.gk'\nGENKEYCSR_EMAIL='contact@genkey.gk'\n\n# logo and favicon are relative to the static folder\nGENKEYCSR_LOGO='images/keycsr_default_logo.jpg'\nGENKEYCSR_FAVICON='images/keycsr_default_favicon.png'\n~~~\n\nTest your new configuration. E.g., if you put the config file in the root folder of your project:\n\n    (.env) $ GENKEYCSR_CONFIG_PATH=$PWD/config.py ./run.py\n\n### Default logo and favicon\n\nYou can change the default logo and default favicon via GENKEYCSR\\_DEFAULT\\_LOGO and GENKEYCSR\\_DEFAULT\\_FAVICON in the configuration file. Put your images under gen\\_keycsr/static/images and use a path relative to /static to point them.\n\n### How To Use It\n\nWell, it's kind of obvious, really. You call the page, fill in all the fields and click the __Generate__ button. The Private Key and the certificate signing request will be presented in the boxes bellow the form. You can copy the key/csr or you can save them clicking on the icons. _you cannot copy to clipboard in any modern browser if not running under ssl (https://)_.\n\n----------------\n### Running under apache\n\n#### Ubuntu 21.04+\n    Install mod_wsgi for Python version 3\n    # sudo apt-get install libapache2-mod-wsgi-py3\n\n    Copy the sample configuration from the docs/ folder to apache\n    # cd /srv/genkeycsr\n    # sudo cp docs/genkeycsr.conf /etc/apache2/conf-available\n    \n    Adjust settings (paths, ports, ssl certificates etc)\n    # sudo vi /etc/apache2/conf-available/genkeycsr.conf\n    \n    Enable the configurattion\n    # sudo a2enconf genkeycsr\n    \n    Copy the file docs/sample_wsgi.conf as config.py and customize it\n    # sudo cp docs/sample_wsgi.conf wsgi.conf\n    # sudo vi wsgi.conf\n    \n    Reload apache\n    # sudo systemctl reload apache2.service\n\n#### RedHat/CentOS 7 || RedHat/CentOS/Rocky 8\n    Install mod_wsgi for Python version 3\n    # sudo yum install python3-mod_wsgi\n\n    Copy the sample configuration from the docs/ folder to apache\n    # cd /srv/genkeycsr\n    # sudo cp docs/genkeycsr.conf /etc/httpd/conf.d\n    \n    Adjust settings (paths, ports, ssl certificates etc)\n    # sudo vi /etc/httpd/conf.d/genkeycsr.conf\n\n    Copy the file docs/sample_wsgi.conf as config.py and customize it\n    # sudo cp docs/sample_wsgi.conf wsgi.conf\n    # sudo vi wsgi.conf\n    \n    Reload apache\n    # sudo systemctl reload httpd.service\n\n    If you have selinux enabled (you should), use this command to enable the site under apache\n    # chcon -Rv --type=httpd_sys_script_exec_t /srv/genkeycsr/\n\n#### Configuration file genkeycsr.conf \n~~~\n#\n# Configuration file for use in apache with mod_wsgi\n#\n#\n\u003cVirtualHost *:443\u003e\n\n     ServerName fully-qualified.domain.name\n\n     # Redhat/CentOS etc\n     WSGIDaemonProcess genkeycsr user=apache group=apache threads=2\n     # Debian/Ubuntu etc\n     #WSGIDaemonProcess genkeycsr user=www-data group=www-data threads=2\n\n     WSGIScriptAlias /genkeycsr /srv/genkeycsr/wsgi.py\n\n     \u003cDirectory /srv/genkeycsr\u003e\n         Require all granted\n     \u003c/Directory\u003e\n\n     SSLEngine on\n     SSLCertificateFile /etc/letsencrypt/live/fully-qualified.domain.name/cert.pem\n     SSLCertificateKeyFile /etc/letsencrypt/live/fully-qualified.domain.name/privkey.pem\n\n\u003c/VirtualHost\u003e\n~~~\n\n#### wsgi.py file\n~~~python\n#!/usr/bin/python3\n\nimport sys\nimport os\nimport site\n\n# python 3.6 (Redhat/CentOS 7)\n#site.addsitedir('/srv/genkeycsr/.env/lib/python3.6/site-packages')\n# python 3.9 (Ubuntu 20.04+, RedHat/CentOS/Rocky 8)\nsite.addsitedir('/srv/genkeycsr/.env/lib/python3.9/site-packages')\n\n# if you want to change default config values, copy the sample_config.py file under docs/ \n# to the root of the environment and modify the options there\n#\n# you can also change the location of this file and set it here\n#\nos.environ['GENKEYCSR_CONFIG_PATH'] = '/srv/genkeycsr/config.py'\n\nsys.path.insert(0, '/srv/genkeycsr')\n\nfrom genkeycsr import app as application\n\napplication.config['ready'] = True\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudacgf%2Fgenkeycsr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdudacgf%2Fgenkeycsr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdudacgf%2Fgenkeycsr/lists"}