Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Simple library to verify a file with gpg signature.

License

Notifications You must be signed in to change notification settings

tommy-muehle/php-gpg-verifier

Repository files navigation

php-gpg-verifier

Latest Stable Version Total Downloads Build Status Code Climate Test Coverage Minimum PHP Version GitHub license GitHub issues

No Maintenance Intended

Simple library to verify a file with gpg signature. Look at the documentation for more information.

Requirements

Except PHP and composer you need an accessible GPG binary in your $PATH variable.

Install

composer require tm/gpg-verifier ^1.0

Basic usage

use TM\GPG\Verification\Verifier;

$verifier = new Verifier;
$verifier->verify('my-file.sig', 'my-file');

Advanced usage

use TM\GPG\Verification\Verifier;
use TM\GPG\Verification\Exception\FailedVerificationException;
use TM\GPG\Verification\Exception\ExecutableException;
use TM\GPG\Verification\Exception\NotExistException;

$verifier = new Verifier('/path/to/gpg');

try {
    $verifier->verify('my-file.sig', 'my-file');
} catch(FailedVerificationException $exception) {
    // verification failed
} catch(NotExistException $exception) {
    // missing signature- or source-file
} catch(ExecutableException $exception) {
    // something with the executable is wrong
}

Changelog

See here the full changelog.

Contributing

Please refer to CONTRIBUTING.md for information on how to contribute.

About

Simple library to verify a file with gpg signature.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages