php脚本调用gpg命令
php中的system()调用用于调用外部程序。我如何通过php脚本调用gpg(gnupg命令)进行加密。
system() call in php used to call external program .How can i call gpg (gnupg commands) for encryption through php script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
http://php.net/manual/en/book.gnupg.php
http://php.net/manual/en/book.gnupg.php
使用 PEAR 中的 Crypt_GPG 包 ( http://pear.php.net/package/Crypt_GPG )几个月前,当我需要做类似的事情时,对我来说很有吸引力。使用它的 API 可以更快地完成工作,并且还可以使我免于犯愚蠢的错误 - 即以错误的顺序获取参数/参数。
Using the Crypt_GPG package from PEAR ( http://pear.php.net/package/Crypt_GPG ) worked a charm for me a few months ago when I needed to do similar. Using it's API made it much quicker to get things done and also insulated me from making stupid mistakes - namely getting things wrong re getting the arguments/parameters in the wrong order.
我用来做这样的事情
,假设常量 PGP_BIN_PATH 定义了 pgp 二进制文件的路径,而 PGP_RECIPIENT 是目标名称,我认为 PGP 必须首先知道它。
What I used for doing such
assumming constants PGP_BIN_PATH defines path to pgp binary and PGP_RECIPIENT is the dest name, I think it must be known by PGP first.