New signer implementation in Go
Find a file
Jan Dittberner e5dcf7afa9 Refactor COBS wire protocol
Wire protocol handling has been moved to protocol.Framer and its
implementation protocol.COBSFramer
2022-11-29 09:57:23 +01:00
cmd Refactor COBS wire protocol 2022-11-29 09:57:23 +01:00
docs Rename intermediary CA to subordinate CA 2022-08-03 16:01:06 +02:00
internal Refactor COBS wire protocol 2022-11-29 09:57:23 +01:00
pkg Refactor COBS wire protocol 2022-11-29 09:57:23 +01:00
.gitattributes First DDD based signer implementation parts 2021-08-23 20:53:43 +02:00
.gitignore Implement command type handling 2022-11-20 18:59:37 +01:00
.golangci.yml Move internal code to internal packages 2022-11-28 17:39:48 +01:00
.goreleaser.yaml Add goreleaser configuration 2022-04-16 14:43:05 +02:00
go.mod Protocol improvements 2022-11-28 17:10:46 +01:00
go.sum Protocol improvements 2022-11-28 17:10:46 +01:00
LICENSE Configure and apply golangci-lint 2022-04-24 09:25:04 +02:00
Makefile Protocol improvements 2022-11-28 17:10:46 +01: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.