dataground / simplepgp
此包的最新版本(0.2.0)没有可用的许可证信息。
纯PHP简单PGP解密
0.2.0
2017-11-19 14:53 UTC
Requires
- singpolyma/openpgp-php: ^0.3
This package is auto-updated.
Last update: 2024-09-22 20:24:38 UTC
README
这是一个非常简单的库,用于使用出色的(但相当复杂的)Singpoyma OpenPGP库进行PGP解密。很多人在使用GnuPG/OpenPGP/PGP解密在自动化工作流程中遇到了复杂性问题。SimplePGP试图解决这个问题,它可以在没有任何依赖的情况下解密数据,无需将私钥添加到任何本地密钥环中。
安装
composer install dataground/simplepgp
输入格式
- 私钥文件应该是ascii武装格式(大多数密钥导出工具的默认格式)
- 输入文件内容应该是base64编码格式(不是二进制)
示例
$spgp = new SimplePgp(); $decrypted = $spgp->decrypt( file_get_contents('/path/to/my_encrypted_file'), file_get_contents('/path/to/my_privatekey_file'), 'myVerySecretKeyPassPhrase' );
待办事项
- 添加加密支持
- 改进错误处理
- 添加测试和示例
贡献
非常欢迎贡献,请遵循 [http://www.phptherightway.com/] 最佳实践。