2 # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant)
4 # Monkeysphere host set-expire subcommand
6 # This is a function to set the expiration date of the monkeysphere
9 # The monkeysphere scripts are written by:
10 # Jameson Rollins <jrollins@finestructure.net>
11 # Jamie McClelland <jm@mayfirst.org>
12 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
14 # They are Copyright 2008-2010, and are all released under the GPL,
24 Must specify expiration. The possibilities are:
25 0 = key does not expire
26 <n> = key expires in n days
27 <n>w = key expires in n weeks
28 <n>m = key expires in n months
29 <n>y = key expires in n years
36 keyID=$(check_key_input "$@")
38 if [ "$PROMPT" != "false" ] ; then
39 printf "Are you sure you want to change the expiration on key '$keyID' by '%s'? (Y/n) " "$extendBy" >&2
41 if [ "${OK/y/Y}" != 'Y' ] ; then
42 failure "expiration not set."
45 log debug "extending without prompting."
48 log info "setting key expiration to ${extendBy}."
50 log debug "executing key expire script..."
51 gpg_host_edit "0x${keyID}!" expire <<EOF
59 NOTE: Key expiration date adjusted, but not yet published.
60 Run '$PGRM publish-key' to publish the new expiration date.