Batch encrypt with public key using Gpg4win command line

回眸只為那壹抹淺笑 提交于 2019-12-06 01:54:52

Use the --recipient option to denote keys to encrypt for. GnuPG has a distinction between options and commands, while options should better go first.

gpg --batch --recipient [key-id] --encrypt-files "%encryptingfir%\*.pgp"

GnuPG expects keys to be imported to the keychain, so gpg --import [key-file] it first. There are hacks using --keyring [your-key-file], but simply importing the key file is the safer way to go.

For scripted/programmed operations, best practice is to always denote the full fingerprint. Read about key ID collisions to understand the issues with short key IDs.

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