本文介紹了GPG 錯誤代碼 2的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
GPG 的結果總是返回 2.我的代碼如下
GPG is always returning 2 at the result. My code is as follows
$cmd = "/usr/bin/gpg -a --recipient $to -e -o $outfile $infile";
其中 outfile 是加密數據將寫入的文件,infile 是未加密數據.
Where outfile is the file where the encrypted data will be written and infile is the unencrypted data.
我不知道為什么會這樣.誰能告訴我出了什么問題.謝謝.
I don't know why this is happening. Can anyone please tell me what's wrong. Thanks.
推薦答案
GPG 詢問您是否要繼續使用未簽名的密鑰進行加密.由于沒有用戶可以輸入 Y
,它會產生一個錯誤.
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
和 --always-trust
這篇關于GPG 錯誤代碼 2的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!