roave/signature

Sign and verify stuff

Installs: 2 507 480

Dependents: 11

Suggesters: 0

Security: 0

Stars: 34

Watchers: 10

Forks: 3

Open Issues: 1

1.5.0 2021-09-18 13:37 UTC

This package is auto-updated.

Last update: 2021-11-18 13:59:05 UTC


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'));