roave / signature
签署和验证内容
1.8.0
2023-11-25 00:11 UTC
Requires
- php: ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0
Requires (Dev)
- doctrine/coding-standard: ^12.0.0
- infection/infection: ^0.26.19
- phpunit/phpunit: ^9.6.7
- vimeo/psalm: ^5.9.0
- 1.9.x-dev
- 1.8.x-dev
- 1.8.0
- 1.7.x-dev
- 1.7.0
- 1.6.x-dev
- 1.6.0
- 1.5.x-dev
- 1.5.0
- 1.4.x-dev
- 1.4.0
- 1.3.x-dev
- 1.3.0
- 1.2.x-dev
- 1.2.0
- 1.1.x-dev
- 1.1.0
- 1.0.0
- dev-renovate/phpunit-phpunit-11.x
- dev-renovate/all-minor-patch
- dev-renovate/lock-file-maintenance
- dev-renovate/actions-checkout-4.x
- dev-renovate/phpunit-phpunit-10.x
This package is auto-updated.
Last update: 2024-09-19 14:56:28 UTC
README
轻松签署和验证签名文件。
注意:这不是一个加密签名库。
安装
建议的安装方法是使用 composer
$ composer require roave/signature
使用示例
签署文件
// Creating a signer $signer = new \Roave\Signature\FileContentSigner( new \Roave\Signature\Encoder\Sha1SumEncoder() ); // It'll give you a signature to the provided code content $signature = $signer->sign(file_get_contents('/var/tmp/file.php'));
验证签名文件
// Creating a signer checker $signer = new \Roave\Signature\FileContentChecker( new \Roave\Signature\Encoder\Sha1SumEncoder() ); // It'll validate the signature on file content $signer->check(file_get_contents('/var/tmp/signed-file.php'));