summaryrefslogtreecommitdiff
path: root/src/subcommands/mh/extend-key
blob: 8f1ecc29508af0accb014490b1b162410e1e64e9 (plain)
  1. #!/usr/bin/env bash
  2. # Monkeysphere host extend-key subcommand
  3. #
  4. # The monkeysphere scripts are written by:
  5. # Jameson Rollins <jrollins@fifthhorseman.net>
  6. # Jamie McClelland <jm@mayfirst.org>
  7. # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
  8. #
  9. # They are Copyright 2008, and are all released under the GPL, version 3
  10. # or later.
  11. # extend the lifetime of a host key:
  12. extend_key() {
  13. local fpr=$(fingerprint_server_key)
  14. local extendTo="$1"
  15. # get the new expiration date
  16. extendTo=$(get_gpg_expiration "$extendTo")
  17. gpg_host --quiet --command-fd 0 --edit-key "$fpr" <<EOF
  18. expire
  19. $extendTo
  20. save
  21. EOF
  22. echo
  23. echo "NOTE: Host key expiration date adjusted, but not yet published."
  24. echo "Run '$PGRM publish-key' to publish the new expiration date."
  25. }