PHPackages                             verdient/signature - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. verdient/signature

ActiveLibrary

verdient/signature
==================

A simple library to work with Web Signature

0.1.0(5y ago)05384MITPHPPHP &gt;=7.0.0

Since Feb 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Verdient/signature)[ Packagist](https://packagist.org/packages/verdient/signature)[ Docs](https://github.com/Verdient/signature)[ RSS](/packages/verdient-signature/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (4)

Signature
=========

[](#signature)

签名

安装
--

[](#安装)

```
composer require verdient/signature
```

创建签名实例
------

[](#创建签名实例)

```
use Verdient\signature\Signature;

/**
 * 签名秘钥
 */
$key = '****';

/**
 * 编码器
 * 默认为signature\encoder\HmacEncoder
 * 系统内置了HmacEncoder和Base64Encoder，也可以通过实现EncoderInterface来实现自己的编码器
 * 可以通过数组的方式来配置，格式为
 * [
 *     'class' => {className}
 *     ${property1} => ${property1},
 *     ${property2} => ${property2},
 *     ...
 * ]
 */
$encoder = 'Verdient\signature\encoder\HmacEncoder';

$sign = new Signature([
	'key' => $key,
	'encoder ' => $encoder
]);
```

对数据进行签名
-------

[](#对数据进行签名)

```
/**
 * 待签名的数据
 * 可以为字符串和数组
 */
$data = ['key1' => 1, 'key2' => 2, 'key3' => 3];

$signature = $sign->sign($data);
```

验证签名
----

[](#验证签名)

```
$sign->validate($data, $signature);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~220 days

Total

3

Last Release

1840d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/606eaa4bc61b11fa19f25526a3084758b7086ceb8b11cdbcafd5df11871f2437?d=identicon)[Verdient。](/maintainers/Verdient%E3%80%82)

---

Top Contributors

[![Verdient](https://avatars.githubusercontent.com/u/22468867?v=4)](https://github.com/Verdient "Verdient (4 commits)")

---

Tags

websignaturelibraryverify

### Embed Badge

![Health badge](/badges/verdient-signature/health.svg)

```
[![Health](https://phpackages.com/badges/verdient-signature/health.svg)](https://phpackages.com/packages/verdient-signature)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k434.8M1.3k](/packages/phpseclib-phpseclib)[behat/mink

Browser controller/emulator abstraction for PHP

1.6k86.1M606](/packages/behat-mink)[hprose/hprose

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

2.1k215.3k37](/packages/hprose-hprose)[spomky-labs/pki-framework

A PHP framework for managing Public Key Infrastructures. It comprises X.509 public key certificates, attribute certificates, certification requests and certification path validation.

2725.9M11](/packages/spomky-labs-pki-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
