roave / signature
Sign and verify stuff
Installs: 4 984 658
Dependents: 3
Suggesters: 0
Security: 0
Stars: 41
Watchers: 9
Forks: 3
Open Issues: 2
Requires
- php: 8.0.*|8.1.*|8.2.*
Requires (Dev)
- doctrine/coding-standard: ^10.0.0
- infection/infection: ^0.26.15
- phpunit/phpunit: ^9.5.25
- vimeo/psalm: ^4.28.0
README
Sign and validate signed files made easy.
Note: this is not a cryptographic signing library.
Installation
The suggested installation method is via composer:
$ composer require roave/signature
Usage examples
Signing a file
// 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'));
Validating a signed file
// 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'));