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