New signer implementation in Go
Find a file
Jan Dittberner 60be959c24 Implement health check infrastructure
This commit adds health check capabilities to the hsm.Access and health
response data to the messages returned by the health command.
2022-08-03 15:45:27 +02:00
cmd Implement health check infrastructure 2022-08-03 15:45:27 +02:00
docs Implement serial link and protocol handling infrastructure 2022-08-03 14:38:36 +02:00
pkg Implement health check infrastructure 2022-08-03 15:45:27 +02:00
.gitattributes First DDD based signer implementation parts 2021-08-23 20:53:43 +02:00
.gitignore Implement serial link and protocol handling infrastructure 2022-08-03 14:38:36 +02:00
.golangci.yml Add test for pkg/hsm/context.go 2022-04-24 14:05:46 +02:00
.goreleaser.yaml Add goreleaser configuration 2022-04-16 14:43:05 +02:00
go.mod Implement serial link and protocol handling infrastructure 2022-08-03 14:38:36 +02:00
go.sum Implement serial link and protocol handling infrastructure 2022-08-03 14:38:36 +02:00
LICENSE Configure and apply golangci-lint 2022-04-24 09:25:04 +02:00
README.md Implement serial link and protocol handling infrastructure 2022-08-03 14:38:36 +02:00

Running with softhsm2

Setup HSM keys and certificates

sudo apt install softhsm2
umask 077
mkdir -p ~/.config/softhsm2/tokens
echo "directories.tokendir = $HOME/.config/softhsm2/tokens/" > ~/.config/softhsm2/softhsm2.conf
cp docs/config.sample.yaml config.yaml
# modify config.yaml to fit your needs
softhsm2-util --init-token --free --label localhsm --so-pin 47110815 --pin 123456
# initialize the keys
export PKCS11_PIN_LOCALHSM=123456
go run ./cmd/signer -setup

Run the signer

export PKCS11_PIN_LOCALHSM=123456
go run ./cmd/signer

Run the client simulator with socat

You may run the client simulator that sends commands via stdout and reads responses on stdin via socat to simulate traffic on an emulated serial device:

sudo apt install socat
go build ./cmd/clientsim
socat -d -d -v pty,rawer,link=$(pwd)/testPty EXEC:./clientsim,pty,rawer

You will need to configure $(pwd)/testPty as serial/device in your config.yaml to let the signer command find the emulated serial device.