Makefile 925 B

12345678910111213141516171819202122232425262728293031
  1. all : cert-bundle.pem cert-openssl-text
  2. keygrip.hex : cert-request.pem
  3. ./sexp-gen/create-gpg-shadow-key-from-x509-cert-req.py \
  4. --gpg-key-output-path '{keygrip_hex}.key' \
  5. --keygrip-hex-output-path '$@' \
  6. $^
  7. gpgsm-params : gpgsm-params.template keygrip.hex
  8. sed "s/{{keygrip}}/$(shell cat keygrip.hex)/" $< > $@
  9. cert.der : gpgsm-params keygrip.hex
  10. cat $^
  11. ln --symbolic --backup "${PWD}/$(shell cat keygrip.hex).key" ~/.gnupg/private-keys-v1.d/
  12. gpgsm --gen-key --batch --output $@ < $<
  13. cert.pem : cert.der
  14. openssl x509 -inform DER -in $< -outform PEM -out $@
  15. cert-openssl-text : cert.pem
  16. openssl x509 -in $< -text -noout
  17. cert-bundle.pem : cert.pem gpgsm-params
  18. cat cert.pem > $@
  19. gpgsm --armor --export \
  20. \&$(shell grep --perl-regexp --only-matching 'Signing-Key: \K\w+' gpgsm-params) \
  21. >> $@
  22. clean :
  23. -rm keygrip.hex "$(shell cat keygrip.hex).key" gpgsm-params \
  24. cert.der cert.pem cert-bundle.pem