Create pgp file with gpg from command line

非 Y 不嫁゛ 提交于 2021-02-08 15:14:47

问题


I want to encrypt an xml file and I am using gpg4win (kleopatra). Using the kleopatra interface I set an option to produce files with extension pgp instead of gpg which is the default extension.

I am trying to create a pgp file from command line using the command

gpg -r test@test.gr -se C:\temp\myfile.xml

because I need to submit it in a web app that accepts pgp only. I have tried to put some other options in the command but I always get a gpg file. How can I produce a pgp file from command line?


回答1:


This may not be the same process as others, but this worked for me:

gpg --batch --yes --recipient "user" --output "fulldirectory\filename.txt.pgp" --encrypt "fulldirectory\filename.txt"



回答2:


GnuPG syntax for encryption is stated here. You can simply use the --output [filename].[suffix] parameter.

So go with gpg --encrypt C:\temp\myfile.xml --recipient test@test.gr --output C:\temp\myfile.pgp.

Please note that .pgp is actually the suffix for a key not an encrypted file. See here.



来源:https://stackoverflow.com/questions/36736086/create-pgp-file-with-gpg-from-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!