Git Product home page Git Product logo

internal-ca's Introduction

Getting started

Optionally clear the CA folder:

sudo rm -rf /root/ca

Grab the scripts:

cd
rm -rf ~/internal-ca
git clone https://github.com/bhagadepravin/internal-ca.git
cd ~/internal-ca
chmod +x *.sh

Customize openssl.cnf files as needed or keep default values.

You can now create your certs. As an example, to create certs as per the diagram above:

cd ~/internal-ca
sudo ./create_root.sh

sudo ./create_intermediate.sh intermediate
sudo ./create_server.sh intermediate c474-node1.coelab.cloudera.com

sudo ./create_intermediate.sh int3  
sudo ./create_client.sh int3 deviceA  
export certs

All the certificates are stored in /root/ca. To export them into a given folder:

Usage: ./export.sh -i <intermediate-name> -c <certificate-name> -d <dest-folder> [-k] [-h]
  -h  Display help
  -i  name of the intermediate  
      (it's the /root/ca/<intermediate-name>)
  -c  name of the certificate ("intermediate" or client/server name) 
      (it's /root/ca/<intermediate-name>/certs/<CERT_NAME>.cert.pem and /root/ca/<intermediate-name>/private/<CERT_NAME>.cert.pem)
  -d  destination folder
  -k  exports the private key

Examples:

  to extract the intermediate "intermediate" (including private key) into ~/exported:
    ./export.sh -i intermediate -c intermediate -d ~/exported -k

  to extract the server "c474-node1.coelab.cloudera.com" (including private key) into ~/exported:
    ./export.sh -i intermediate -c c474-node1.coelab.cloudera.com -d ~/exported -k

  to extract the client "device3" (including private key) into ~/exported:
    ./export.sh -i intermediate -c device3 -d ~/exported -k

View and verify certs

To optionally view the ROOT certificate:

sudo openssl x509 -noout -in /root/ca/certs/ca.cert.pem -noout -subject -issuer

To view the INTERMEDIATE certificates:

# NOTE: replace `<INTERMEDIATE>` with the intermediate name

sudo openssl x509 -noout -in <INTERMEDIATE>/certs/intermediate.cert.pem -noout -subject -issuer

To verify INTERMEDIATE against ROOT:

# NOTE: replace `<INTERMEDIATE>` with the intermediate name
sudo openssl verify -CAfile /root/CA/certs/ca.cert.pem /root/CA/<INTERMEDIATE>/certs/intermediate.cert.pem

internal-ca's People

Contributors

bhagadepravin avatar

Watchers

 avatar  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.