New signer implementation in Go
Jan Dittberner
de997913cf
This commit implements a mechanism to load CA configuration dynamically from JSON files. Missing keys and certificates can be generated in a PKCS#11 HSM or Smartcard. Certificates are stored as PEM encoded .crt files in the filesystem. The default PKCS#11 module (softhsm2) is now loaded from a platform specific path using go:build comments. |
||
---|---|---|
cmd/signer | ||
openpgp/signing | ||
pkg | ||
x509 | ||
.gitattributes | ||
.gitignore | ||
.goreleaser.yaml | ||
go.mod | ||
go.sum | ||
README.md |
Testing with softhsm2
sudo apt install softhsm2 gnutls-bin
umask 077
mkdir -p ~/.config/softhsm2/tokens
echo "directories.tokendir = $HOME/.config/softhsm2/tokens/" > ~/.config/softhsm2/softhsm2.conf
softhsm2-util --init-token --free --label localhsm --so-pin 47110815 --pin 123456
export TOKEN_URL=$(p11tool --list-token-urls | grep localhsm | head -1)
p11tool --login --outfile=rootkey2022.pub --label=rootkey2022 --generate-privkey=ECDSA --curve=secp521r1 $TOKEN_URL
go test -v ./cmd/signer/
openssl x509 -in /tmp/test.pem -noout -text