Giter Site home page Giter Site logo

shellcsrgen's Introduction

shellcsrgen Generate a CSR+Key from the shell with a GUI

Contents

What is this?

This script allows you to generate a CSR (and the relative key) with Openssl with ease, providing you with a GUI to input all the necessary parameters (CN, SANs, key length, ecc.)

How does it work?

The generation is performed by openssl, while the graphical interface is rendered via dialog. At the end the script produces a .CSR, to be used with your Certification Authority to generate a certificate, and .KEY file containing the private key.

Prerequisites

  • You will need the openssl toolkit, in most cases it is installed by default on all Linux distributions (openssl GitHub page).
  • The graphical interface is provided by Dialog, so you will need to install it to make this script work.

Installation

  1. Make sure Dialog is available on your system by running:
dialog --version

If not, you can install it by following the instructions in this chapter

  1. Make sure openssl is available on your system by running:
openssl version
  1. Download shellcsrgen.sh from the main branch to your local machine:
wget https://raw.githubusercontent.com/EarlyOwl/ShellCSRGen/main/shellcsrgen.sh
  1. Make it executable:
chmod +x shellcsrgen.sh
  1. Run the script with:
./shellcsrgen.sh

Usage

The procedure is pretty straightforward. At first you will have to provide the Country (C), State (S), Locality (L), Organization Name (O), Organizational Unit (OU) and, most importantly, the Common Name (CN): Screenshot 2023-10-02 194134

A prompt will ask you if you want to provide Subject Alternative Names (SAN). If you want to do so, select Yes. You will then be able to insert as many IP/DNS SANs as you want. Screenshot 2023-10-02 200121 Screenshot 2023-10-02 194153

The next selection will give 4 options for the key length: 2048, 3072, 4096 and 7168 Screenshot 2023-10-02 194206

A confirmation screen will show a brief summary of the provided data. If everything's correct, select Yes to proceed. Screenshot 2023-10-02 194213

Finally you will be able to choose the filename/path for both the CSR and the KEY. At the end a confirmation screen will inform you of the successful creation of the files. Screenshot 2023-10-02 194219 Screenshot 2023-10-02 194229

How do I install Dialog?

If Dialog is not present on your machine, you can run those commands based on your current OS / distro to install it:

Ubuntu / Debian
sudo apt-get update
sudo apt-get install dialog
RHEL / CentOS
sudo yum install dialog
MacOS

Install it via HomeBrew by running:

brew install dialog

Misc

Can I contribute? Can I reuse all/part of this script for other purposes?

Yes and yes.

This sucks / You could have done X instead of X!

I'm eager to learn, open an issue or a pull request to suggest an improvement / fix.

shellcsrgen's People

Contributors

earlyowl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.