tm/gpg-verifier

该软件包已被废弃,不再维护。未建议替代软件包。

用于验证带有 gpg 签名的文件的简单库。

1.1.0 2016-08-09 12:02 UTC

This package is auto-updated.

Last update: 2021-06-08 15:20:51 UTC


README

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

No Maintenance Intended

用于验证带有 gpg 签名的文件的简单库。有关更多信息,请参阅文档

需求

除了 PHP 和 composer,您还需要在 $PATH 变量中可访问的 GPG 二进制文件。

安装

composer require tm/gpg-verifier ^1.0

基本用法

use TM\GPG\Verification\Verifier;

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

高级用法

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
}

变更日志

查看完整的变更日志这里

贡献

有关如何贡献的信息,请参阅CONTRIBUTING.md