martinusso / xml-signer
此软件包已被放弃,不再维护。未建议替代包。
XML Signer 允许您对 XML 文档进行签名
1.0.0
2017-10-17 10:43 UTC
Requires
- php: ^5.6 || ^7.0
- ext-dom: *
- ext-openssl: *
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2020-02-21 17:55:17 UTC
README
XML Signer 允许您使用 X.509 数字证书对 XML 文档进行签名。
安装
您可以通过两种方式安装 xml-signer
通过 Composer 安装
$ composer require martinusso/xml-signer
或者,克隆 Git 仓库(https://github.com/martinusso/xml-signer
)。
如何使用
使用 PFX 文件实例化证书对象
$password = '.pfx password here!';
$pfx = file_get_contents('path/to/certificate.pfx');
$certificate = Certificate::readPfx($pfx, $password);
对 XML 进行签名
$signer = new Signer($certificate);
$xmlSigned = $signer->xml($XmlContent, $tagName);
贡献
有关如何为 XmlSigner 贡献的信息,请参阅 CONTRIBUTING.md
许可证
此库在 MIT 许可证下发布。