GPG Error Code 2

后端 未结 4 1102
情深已故
情深已故 2020-12-07 02:12

GPG is always returning 2 at the result. My code is as follows

$cmd = \"/usr/bin/gpg -a --recipient $to -e -o $outfile $infile\";

Where outfile

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 02:26

    GPG is asking whether you want to continue on with the encryption using an unsigned key. Since no user can input Y it produces an error.

    To fix this put the following switches

    --yes and --always-trust

提交回复
热议问题