create_keys 552 B

12345678910111213141516171819202122232425
  1. #! /bin/bash
  2. export GNUPGHOME=$PWD/gpg
  3. create_key() {
  4. KEYUID="$1"
  5. EPOCH="$2"
  6. echo creating key for "$KEYUID"
  7. EPOCH_OPT=""
  8. if [ "$EPOCH" != "" ]
  9. then
  10. EPOCH_OPT=" --faked-system-time $EPOCH "
  11. fi
  12. gpg $EPOCH_OPT --batch --passphrase "" --quick-generate-key "$KEYUID" default default never
  13. }
  14. # create keys with date in the past, to be able to manually expire them at some
  15. # later time in the past for testing
  16. create_key "Développeur <developpeur@example.com>" 20200202T200000
  17. create_key "Snowman ☃ <snowman@example.com>" 20200202T200000