# -*-shell-script-*- # This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) # Monkeysphere gen-subkey subcommand # # The monkeysphere scripts are written by: # Jameson Rollins # Jamie McClelland # Daniel Kahn Gillmor # # They are Copyright 2008-2009, and are all released under the GPL, # version 3 or later. # generate a subkey with the 'a' usage flags set gen_subkey(){ local keyLength local gpgSecOut local keyID local editCommands local fifoDir # get options while true ; do case "$1" in -l|--length) keyLength="$2" shift 2 ;; *) if [ "$(echo "$1" | cut -c 1)" = '-' ] ; then failure "Unknown option '$1'. Type '$PGRM help' for usage." fi break ;; esac done # check that the keyID is unique keyID=$(check_gpg_sec_key_id "$@") # check that an authentication subkey does not already exist check_gpg_authentication_subkey "$keyID" # generate the list of commands that will be passed to edit-key editCommands=$(cat <