PHPackages                             exewen/digital-signature-php-sdk - 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. [API Development](/categories/api)
4. /
5. exewen/digital-signature-php-sdk

ActiveLibrary[API Development](/categories/api)

exewen/digital-signature-php-sdk
================================

(Custom) An SDK for using eBay's APIs that require a digital signature

v2.0.0(1y ago)09Apache-2.0PHPPHP &gt;=7.3

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/exewen/digital-signature-php-sdk)[ Packagist](https://packagist.org/packages/exewen/digital-signature-php-sdk)[ Docs](https://github.com/exewen/digital-signature-php-sdk)[ RSS](/packages/exewen-digital-signature-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

Custom Digital Signature SDK
============================

[](#custom-digital-signature-sdk)

HTTP message signatures provide a mechanism for end-to-end authenticity and integrity for components of an HTTP message.

This PHP SDK is designed to simplify the process of generating digital signature headers and also provides a method to validate the digital signature headers.

Table of contents
-----------------

[](#table-of-contents)

- [Digital Signatures for Public API Calls](#digital-signatures-for-public-api-calls)
- [Features](#features)
- [Usage](#usage)
- [License](#license)

Digital Signatures for Public API Calls
---------------------------------------

[](#digital-signatures-for-public-api-calls)

Due to regulatory requirements emanating from SCA for our European/UK sellers, we are requiring our developers to add a digital signature for every HTTP call that is made on behalf of a EU/UK seller to certain APIs.

This SDK is generic and the signature scheme is compliant with these upcoming IETF standards (currently not yet RFCs).

- [draft-ietf-httpbis-message-signatures-16](https://www.ietf.org/archive/id/draft-ietf-httpbis-message-signatures-16.html)
- [draft-ietf-httpbis-digest-headers-11](https://www.ietf.org/archive/id/draft-ietf-httpbis-digest-headers-11.html)

Features
--------

[](#features)

This SDK is intended to generate required message signature headers, as per the above IETF standards. There is also an example included with the SDK.

This SDK incorporates

- Generation of the following HTTP message signature headers:
    - **Content-Digest**: This header includes a SHA-256 digest over the HTTP payload (as specified in [draft-ietf-httpbis-digest-headers-11](https://www.ietf.org/archive/id/draft-ietf-httpbis-digest-headers-11.html)), if any. It is not required to be sent for APIs that do not include a request payload (e.g. GET requests).
    - **Signature-Input**: This header indicates which headers and pseudo-headers are included, as well as the order in which they are used when calculating the signature. It is created as specified in [draft-ietf-httpbis-message-signatures-16](https://www.ietf.org/archive/id/draft-ietf-httpbis-message-signatures-16.html)
    - **Signature**: The value of the Signature header is created as described in [Section 3.1, Creating a Signature](https://www.ietf.org/archive/id/draft-ietf-httpbis-message-signatures-16.html#name-creating-a-signature), of IETF draft-ietf-httpbis-message-signatures-16. It uses the Private Key value generated by the [Key Management API](https://developer.ebay.com/api-docs/developer/key-management/overview.html).
    - **x-ebay-signature-key**: This header includes the JWE that is created using the [Key Management API](https://developer.ebay.com/api-docs/developer/key-management/overview.html)
- `generateSignatureHeaders` method to generate all required headers

For more details on Digital Signatures for eBay APIs please refer to the [documentation](https://developer.ebay.com/develop/guides/digital-signatures-for-apis).

Usage
-----

[](#usage)

**Prerequisites**

```
PHP: 7.3 or higher

```

### Install

[](#install)

In order to use this SDK, add it to your PHP application via composer:

```
composer require ebay/digital-signature-php-sdk
composer update
```

In your code, add this line to return all headers including signature headers:

```
$headers = $signature->generateSignatureHeaders($yourHeaders, $apiUrl, $method, $body);

```

Please also check the [example](#Running-the-example)

### Configure

[](#configure)

In order to run the example application the [example-config.json](./examples/example-config.json) needs to be updated.

```
{
  "digestAlgorithm": "",
  "jwe": "",
  "privateKey": "",
  "privateKeyStr": "",
  "signatureParams": ""
}
```

### Parameters

[](#parameters)

NameTypeDescription`digestAlgorithm`stringThe algorithm for generating the Content-Digest header. Supported vales are `sha-256` and `sha-512``jwe`stringThe JWE generated using the [Key Management API](https://developer.ebay.com/api-docs/developer/key-management/overview.html)`privateKey`stringThe privateKey generated using the [Key Management API](https://developer.ebay.com/api-docs/developer/key-management/overview.html)`privateKeyStr`string(alternative to privateKey) Private key generated using [Key Management API](https://developer.ebay.com/api-docs/developer/key-management/overview.html), surrounded by -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- key headers`signatureParams`ArrayThe list of headers that indicates which headers and pseudo-headers are included, as well as the order in which they are used when calculating the signatureNote: You can refer to [example-GET.php](examples/example-GET.php) or [example-POST.php](examples/example-POST.php) for examples of how to use the SDK (for a GET call without request body and for a POST call with body, respectively).

### Running the example

[](#running-the-example)

```
cd examples
composer update
php example-GET.php # or php example-POST.php
```

- Signing Configuration Sample: [example-config.json](examples/example-config.json).

License
-------

[](#license)

Copyright 2023 eBay Inc. Developer: Ulrich Herberg and Arturas Sendrauskas

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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 ~15 days

Total

6

Last Release

649d ago

Major Versions

v1.2.1 → v2.0.02024-07-29

PHP version history (2 changes)v1.0.0PHP &gt;=7.3

v1.2.0PHP &gt;=7.3|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f67ab9c12b404ad0421408edf24832eff0d0d7c750c85a784b1a3a15fb2648f?d=identicon)[exeweb](/maintainers/exeweb)

---

Top Contributors

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

---

Tags

apisecuritycryptographydigital-signature

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/exewen-digital-signature-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/exewen-digital-signature-php-sdk/health.svg)](https://phpackages.com/packages/exewen-digital-signature-php-sdk)
```

###  Alternatives

[jayzeng/virustotalapi

VirusTotal Public API v2.0 PHP Wrapper

62140.7k3](/packages/jayzeng-virustotalapi)[codeswholesale/sdk

A PHP wrapper for CodesWholesale's API

3550.3k1](/packages/codeswholesale-sdk)[comgate/sdk

Comgate PHP SDK

13327.8k](/packages/comgate-sdk)[delatbabel/apisecurity

API Security Helpers.

1378.1k](/packages/delatbabel-apisecurity)[saippuakauppias/safe-browsing

Client to use Google's and Yandex Safe Browsing API (v4)

1020.2k](/packages/saippuakauppias-safe-browsing)

PHPackages © 2026

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