summaryrefslogtreecommitdiff
path: root/src/share/mh/extend_key
blob: 79ee267b64849c2c5a61d930007b9d5bac21911f (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_host_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. cat <<EOF | log info
  24. NOTE: Host key expiration date adjusted, but not yet published.
  25. Run '$PGRM publish-key' to publish the new expiration date.
  26. EOF
  27. }