2022-04-20 07:04:24 +00:00
|
|
|
# Running with softhsm2
|
|
|
|
|
|
|
|
## Setup HSM keys and certificates
|
2022-04-13 06:30:20 +00:00
|
|
|
|
|
|
|
```
|
2022-04-20 07:04:24 +00:00
|
|
|
sudo apt install softhsm2
|
2022-04-13 06:30:20 +00:00
|
|
|
umask 077
|
|
|
|
mkdir -p ~/.config/softhsm2/tokens
|
|
|
|
echo "directories.tokendir = $HOME/.config/softhsm2/tokens/" > ~/.config/softhsm2/softhsm2.conf
|
2022-04-20 07:04:24 +00:00
|
|
|
cp docs/config.sample.yaml config.yaml
|
|
|
|
# modify config.yaml to fit your needs
|
2022-04-13 06:30:20 +00:00
|
|
|
softhsm2-util --init-token --free --label localhsm --so-pin 47110815 --pin 123456
|
2022-04-20 07:04:24 +00:00
|
|
|
# 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
|
2022-04-13 06:30:20 +00:00
|
|
|
```
|