PHPackages                             jdmm/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. [Security](/categories/security)
4. /
5. jdmm/signature

ActiveLibrary[Security](/categories/security)

jdmm/signature
==============

提供加密签名算法

1.0.10.x-dev(4y ago)01MITPHP

Since Jun 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/li2301313/jdmm-signature)[ Packagist](https://packagist.org/packages/jdmm/signature)[ RSS](/packages/jdmm-signature/feed)WikiDiscussions 1.0.10 Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

本组件只由一个核心计算方法组层成
----------------

[](#本组件只由一个核心计算方法组层成)

参数说明
----

[](#参数说明)

- $date 请求时间。示例：Wed, 05 Sep. 2012 23:00:00 GMT ，不强制要求时间格式，只是当做字符串处理
- $path 请求路径。示例：/resource/audit
- $query query参数。示例：id=110&amp;name=testName
- $method 请求方式。示例：POST
- $body 主体内容。json格式
- $SecretKey 用户密钥。公共服务数据库（jd\_common）的jd\_api\_auth表查询出请求用户的密钥access\_key\_secret，公共服务提供了RPC查询接口searchSecret()。
- $signature 用户提供的签名

\##使用说明 ###中间件内调用 中间件

加密说明
----

[](#加密说明)

### Header头里要传递的数据

[](#header头里要传递的数据)

名称类型说明Authorization字符串用于验证请求合法性的认证信息。Date字符串HTTP 1.1协议中规定的GMT时间，例如：Wed, 05 Sep. 2012 23:00:00 GMT### 组织参与签名计算的字符串

[](#组织参与签名计算的字符串)

```
Authorization = GroupName + ":" + AccessKeyId + ":" + Signature
Signature = base64(hmac-sha1(AccessKeySecret,
            VERB + "\n"
            + Content-MD5 + "\n"
            + Date + "\n"
			+ Url))

```

当`Body`部分为空时Signature的签名算法

```
Signature = base64(hmac-sha1(AccessKeySecret,
            VERB + "\n"
            + "\n"
            + Date + "\n"
			+ Url))

```

#### GroupName

[](#groupname)

由平台分配

GroupName描述DSPdsp业务#### AccessKeyId

[](#accesskeyid)

调用方的唯一身份标识，由平台分配

#### AccessKeySecret

[](#accesskeysecret)

密钥，由平台分配

#### VERB

[](#verb)

表示HTTP请求的Method，主要有PUT、GET、POST、HEAD、DELETE等，`统一为全大写格式`

#### Content-MD5

[](#content-md5)

Content-MD5 是指 Body 的 MD5 值，只有当 Body 非 Form 表单时才计算 MD5,并转换成小写形式，当body部分为空时，以"\\n"代替，计算方式为：

java:

`String content-MD5 = MD5(bodyStream.getbytes("UTF-8")).toLowerCase();`

php:

`$contentMd5 = strtolower(md5(file_get_contents('php://input')));`

swoft:

`$data = $request->raw();`

#### Url

[](#url)

Url 指 Path + Query 中 Form 参数，组织方法：对 Query 参数按照字典对 Key 进行排序后按照如下方法拼接，如果 Query 参数为空，则 Url = Path，不需要添加 ？，如果某个参数的 Value 为空只保留 Key 参与签名，等号不需要再加入签名。

```
String url =
Path +
"?" +
Key1 + "=" + Value1 +
"&amp;" + Key2 + "=" + Value2 +
...
"&amp;" + KeyN + "=" + ValueN

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1809d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25633267?v=4)[li2301313](/maintainers/li2301313)[@li2301313](https://github.com/li2301313)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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