(command.CommandList
  children: [
    (command.ShFunction
      name: k_gpg_list_keys_public
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<GPG_BIN>} {<--batch>} {<--no-tty>} {<--with-colons>} {<--list-public-keys>} {<-->} 
                  {(DQ ($ Id.VSub_At '$@'))}
                )
                (C {<grep>} {(DQ <'^pub:'>)})
                (command.Simple
                  words: [{<cut>} {<-d>} {(DQ <':'>)} {<-f>} {<5>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_list_keys_secret
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (C {<GPG_BIN>} {<--batch>} {<--no-tty>} {<--with-colons>} {<--list-secret-keys>} {<-->} 
                  {(DQ ($ Id.VSub_At '$@'))}
                )
                (C {<grep>} {(DQ <'^sec:'>)})
                (command.Simple
                  words: [{<cut>} {<-d>} {(DQ <':'>)} {<-f>} {<5>}]
                  redirects: [
                    (redir
                      op: <Id.Redir_Great '2>'>
                      loc: (redir_loc.Fd fd:2)
                      arg: {<'/dev/null'>}
                    )
                  ]
                  do_fork: T
                )
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_create
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<name>} {<email>} {<comment>} {<passphraseLine>} {<gpgOut>} {<result>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:name)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 1))}
                  spids: [222]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:email)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 2))}
                  spids: [230]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:comment)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Number 3>
                          suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
                        )
                      )
                    }
                  spids: [238]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:commentLine)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [247]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:passphrase)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (braced_var_sub
                          token: <Id.VSub_Number 4>
                          suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
                        )
                      )
                    }
                  spids: [252]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:passphraseLine)
                  op: assign_op.Equal
                  rhs: {(DQ )}
                  spids: [261]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name comment))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:commentLine)
                          op: assign_op.Equal
                          rhs: {(DQ <'Name-Comment: '> (${ Id.VSub_Name comment))}
                          spids: [285]
                        )
                      ]
                    )
                  ]
                  spids: [267 282]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-n>} {(DQ (${ Id.VSub_Name passphrase))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:passphraseLine)
                          op: assign_op.Equal
                          rhs: {(DQ <'Passphrase: '> (${ Id.VSub_Name passphrase))}
                          spids: [316]
                        )
                      ]
                    )
                  ]
                  spids: [298 313]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:passphraseLine)
                      op: assign_op.Equal
                      rhs: {(DQ <'%no-protection'>)}
                      spids: [328]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:gpgOut)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ 
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: 
                            (command.Simple
                              words: [{<GPG_BIN>} {<--no-tty>} {<--batch>} {<--generate-key>}]
                              redirects: [
                                (redir
                                  op: <Id.Redir_GreatAnd '2>&'>
                                  loc: (redir_loc.Fd fd:2)
                                  arg: {<1>}
                                )
                                (redir
                                  op: <Id.Redir_DLessDash '<<-'>
                                  loc: (redir_loc.Fd fd:0)
                                  arg: 
                                    (redir_param.HereDoc
                                      here_begin: {<EOT>}
                                      here_end_span_id: 378
                                      stdin_parts: [
                                        <'Key-Type: RSA\n'>
                                        <'Key-Length: 2048\n'>
                                        <'Name-Real: '>
                                        (${ Id.VSub_Name name)
                                        <'\n'>
                                        (${ Id.VSub_Name commentLine)
                                        <'\n'>
                                        <'Name-Email: '>
                                        (${ Id.VSub_Name email)
                                        <'\n'>
                                        (${ Id.VSub_Name passphraseLine)
                                        <'\n'>
                                        <'Expire-Date: 0\n'>
                                        <'%commit\n'>
                                      ]
                                    )
                                )
                              ]
                              do_fork: T
                            )
                        )
                      )
                    }
                  spids: [338]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:result)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_QMark '$?')}
                  spids: [384]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name result)} {<-eq>} {<0>} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.Pipeline
                      children: [
                        (C {<echo>} {(DQ (${ Id.VSub_Name gpgOut))})
                        (C {<head>} {<-n>} {<1>} {<->})
                        (C {<cut>} {<--delimiter>} {(DQ <' '>)} {<--fields>} {<3>})
                      ]
                      negated: F
                    )
                  ]
                  spids: [389 404]
                )
              ]
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Return return>
              arg_word: {(${ Id.VSub_Name result)}
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_password_prompt
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<gpgKey>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:gpgKey)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 1))}
                  spids: [487]
                )
              ]
            )
            (C {<GPG_BIN>} {<--quiet>} {<--edit-key>} {<-->} {(DQ (${ Id.VSub_Name gpgKey))} {<passwd>} 
              {<save>}
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_export_armored
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<key>} {<destination>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:key)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 1))}
                  spids: [556]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:destination)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 2))}
                  spids: [564]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ (${ Id.VSub_Name destination))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:destination)
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name destination) <'/'> (${ Id.VSub_Name key) <.asc>)}
                          spids: [591]
                        )
                      ]
                    )
                  ]
                  spids: [573 588]
                )
              ]
            )
            (command.Simple
              words: [{<GPG_BIN>} {<--armor>} {<--export>} {<-->} {(DQ (${ Id.VSub_Name key))}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ (${ Id.VSub_Name destination))}
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_export
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<key>} {<destination>})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:key)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 1))}
                  spids: [672]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:destination)
                  op: assign_op.Equal
                  rhs: {(DQ (${ Id.VSub_Number 2))}
                  spids: [680]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (C {<Id.Lit_LBracket '['>} {<-d>} {(DQ (${ Id.VSub_Name destination))} 
                              {<Id.Lit_RBracket ']'>}
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:destination)
                          op: assign_op.Equal
                          rhs: {(DQ (${ Id.VSub_Name destination) <'/'> (${ Id.VSub_Name key) <.gpg>)}
                          spids: [707]
                        )
                      ]
                    )
                  ]
                  spids: [689 704]
                )
              ]
            )
            (command.Simple
              words: [{<GPG_BIN>} {<--export>} {<-->} {(DQ (${ Id.VSub_Name key))}]
              redirects: [
                (redir
                  op: <Id.Redir_Great '>'>
                  loc: (redir_loc.Fd fd:1)
                  arg: {(DQ (${ Id.VSub_Name destination))}
                )
              ]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_search_keys
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'query='> (DQ ($ Id.VSub_Number '$1'))})
            (command.Simple
              words: [
                {<GPG_BIN>}
                {<--no-tty>}
                {<--with-colons>}
                {<--batch>}
                {<--search-keys>}
                {<-->}
                {(DQ (${ Id.VSub_Name query))}
              ]
              redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})]
              do_fork: T
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_receive_keys
      body: 
        (BraceGroup
          children: [
            (command.Pipeline
              children: [
                (command.Simple
                  words: [
                    {<GPG_BIN>}
                    {<--no-tty>}
                    {<--batch>}
                    {<--receive-keys>}
                    {<-->}
                    {(DQ ($ Id.VSub_At '$@'))}
                  ]
                  redirects: [(redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})]
                  do_fork: T
                )
                (C {<head>} {<-n>} {<-2>})
                (C {<cut>} {<-c>} {<6->})
              ]
              negated: F
            )
          ]
        )
    )
    (command.ShFunction
      name: k_gpg_keyid_valid
      body: 
        (BraceGroup
          children: [
            (C {<local>} {<Id.Lit_VarLike 'keyId='> (DQ ($ Id.VSub_Number '$1'))})
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.AndOr
                              ops: [Id.Op_DAmp]
                              children: [
                                (C {<Id.Lit_LBracket '['>} 
                                  {
                                    (DQ 
                                      (braced_var_sub
                                        token: <Id.VSub_Name keyId>
                                        suffix_op: 
                                          (suffix_op.Unary
                                            tok: <Id.VOp1_DPercent '%%'>
                                            arg_word: {<0x> <Id.Lit_Other '*'>}
                                          )
                                      )
                                    )
                                  } {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>}
                                )
                                (command.Subshell
                                  child: 
                                    (command.AndOr
                                      ops: [Id.Op_DPipe]
                                      children: [
                                        (C {<Id.Lit_LBracket '['>} 
                                          {
                                            (braced_var_sub
                                              token: <Id.VSub_Name keyId>
                                              prefix_op: (Id.VSub_Pound)
                                            )
                                          } {<-eq>} {<10>} {<Id.Lit_RBracket ']'>}
                                        )
                                        (C {<Id.Lit_LBracket '['>} 
                                          {
                                            (braced_var_sub
                                              token: <Id.VSub_Name keyId>
                                              prefix_op: (Id.VSub_Pound)
                                            )
                                          } {<-eq>} {<18>} {<Id.Lit_RBracket ']'>}
                                        )
                                      ]
                                    )
                                )
                              ]
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:keyId)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (DQ 
                                (braced_var_sub
                                  token: <Id.VSub_Name keyId>
                                  suffix_op: (suffix_op.Unary tok:<Id.VOp1_Pound '#'> arg_word:{<0x>})
                                )
                              )
                            }
                          spids: [964]
                        )
                      ]
                    )
                  ]
                  spids: [908 961]
                )
              ]
            )
            (command.AndOr
              ops: [Id.Op_DAmp]
              children: [
                (command.Subshell
                  child: 
                    (command.AndOr
                      ops: [Id.Op_DPipe]
                      children: [
                        (C {<Id.Lit_LBracket '['>} 
                          {(braced_var_sub token:<Id.VSub_Name keyId> prefix_op:(Id.VSub_Pound))} {<-eq>} {<8>} {<Id.Lit_RBracket ']'>}
                        )
                        (C {<Id.Lit_LBracket '['>} 
                          {(braced_var_sub token:<Id.VSub_Name keyId> prefix_op:(Id.VSub_Pound))} {<-eq>} {<16>} {<Id.Lit_RBracket ']'>}
                        )
                      ]
                    )
                )
                (C {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name keyId))} {<Id.Lit_Equals '='>} 
                  {
                    (DQ 
                      (command_sub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Pipeline
                            children: [
                              (C {<printf>} {(DQ <'%s'>)} {(DQ (${ Id.VSub_Name keyId))})
                              (C {<tr>} {<-c>} {<-d>} {(SQ <ABCDEFabcdef0123456789>)})
                            ]
                            negated: F
                          )
                      )
                    )
                  } {<Id.Lit_RBracket ']'>}
                )
              ]
            )
          ]
        )
    )
  ]
)