Git Product home page Git Product logo

keystone's Introduction

Introduction

Keystone is a key management system. It provides a key management server, offering a gRpc interface, where new keys can be added to a keyring, and then used for things like cryptographic signatures. Keystone supports keys stored in several different ways -- currently: traditional filesystem-based keys and PKCS11 (HSMs both hardware and cloud-based). It offers a plugin API for implementing support for other key storage types.

Prerequisites

  1. Install the basics for building software with go-lang (minimum version as of today is 1.17)
apt -y update && apt -y install build-essential wget git
wget https://dl.google.com/go/go1.17.7.linux-amd64.tar.gz
tar -xvf go1.17.7.linux-amd64.tar.gz
mv go /usr/local

...and install protocol buffers support:

go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
protoc --version
  1. Setup your go-lang environment reasonably
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH="${GOPATH}/bin:$GOROOT/bin:${PATH}"
  1. Clone the repo (which also means for now first cloning the Cosmos SDK)
git clone https://github.com/frumioj/cosmos-sdk.git
git clone https://github.com/frumioj/keystone.git

Build Keystone (I will make this easier one day - promise!)

cd keystone, and then go mod tidy to ensure dependencies are in order

Keystone requires building at least one key-providing plugin. There (as of today) two plugins:

cd plugin/file
go build -buildmode=plugin -o file_keys.so file.go
cd ../pkcs11
go build -buildmode=plugin -o pkcs11_keys.so pkcs11.go

Back up to the top level:

cd ../..
make build

Running the keystone server

This line will run Keystone with support for filesystem-based keys where the keys are stored in the given directory:

./keystoned -chain-id foo -chain-rpc none -key-addr none -keyring-dir none -keyring-type none -key-plugin ./plugin/file/file_keys.so -file-cfg /home/johnk/src/keystoned2/plugin/file/keys/

Dockerfile

There is a Dockerfile in this directory, which implements most of the instructions in here, and can be used to build a Keystone server with:

docker build .

Using keystone

In the test directory is a test program that can be used once you have started the keystone server (see above).

cd test
go build keytester.go
./keytester --help

You can create a new key (make sure you copy the label you is displayed on the screen if you wish to use the key!)

[johnk@fedora test]$ ./keytester -create
New key: eb1966c335055ded66febcfb277f221

keystone's People

Contributors

frumioj avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

frumioj

keystone's Issues

Implement keyring API

Minimally:

  1. Add existing key to keyring
  2. Generate new key on keyring
  3. List keys on a keyring

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.