PHPackages                             rivervanrain/http-signatures-php - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. rivervanrain/http-signatures-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

rivervanrain/http-signatures-php
================================

Sign and verify PSR-7 HTTP messages with HMAC and RSA keys

041PHP

Since Jan 4Pushed 1y agoCompare

[ Source](https://github.com/RiverVanRain/http-signatures-php)[ Packagist](https://packagist.org/packages/rivervanrain/http-signatures-php)[ RSS](/packages/rivervanrain-http-signatures-php/feed)WikiDiscussions wzm Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

Signing HTTP Messages PSR-7 Library
===================================

[](#signing-http-messages-psr-7-library)

[![Build Status](https://camo.githubusercontent.com/f0c1c533fb06cd483e35e4978331a39542f1f83314f2354523920b5209a7086c/68747470733a2f2f7472617669732d63692e6f72672f6c69616d64656e6e6568792f687474702d7369676e6174757265732d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/liamdennehy/http-signatures-php)[![Documentation Status](https://camo.githubusercontent.com/d79ddb9a34442a7418dd310bfae607628825b675f5525dc12342a9cfde061c8b/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f687474702d7369676e6174757265732d7068702f62616467652f3f76657273696f6e3d6c6174657374)](https://http-signatures-php.readthedocs.io/en/latest/?badge=latest)

PHP implementation of [Signing HTTP Messages](http://tools.ietf.org/html/draft-cavage-http-signatures-10) draft specification; allowing cryptographic signing and verifying of [PSR-7 messages](http://www.php-fig.org/psr/psr-7/).

Features
--------

[](#features)

- Sign HTTP Messages according to [Signing HTTP Message draft IETF RFC version 10](http://tools.ietf.org/html/draft-cavage-http-signatures-10)
- Sign &amp; verify messages using HMACs
- Sign &amp; verify messages with Asymmetric Keys:
    - RSA, DSA, EC
- Add a `Digest` header, or automatically add the header while signing in a single operation
- Verify a `Digest` header while verifying the signature

Complete documentation for this library can be found at [Read The Docs](https://http-signatures-php.readthedocs.io/en/latest/)

**WARNING:** Version 11 of this library incorporates [phpseclib](http://phpseclib.sourceforge.net/)'s ongoing work on their [version 3.0 implementation](https://github.com/phpseclib/phpseclib/tree/3.0). If there are any problems please log an issue, but as the library has not been stabilised or completely reviewed you are advised to proceed with caution, or remain at v10 of this library until phpseclib 3.0 is complete and the MAJOR version of this library is bumped.

Simple Usage
------------

[](#simple-usage)

Add [liamdennehy/http-signatures-php](https://packagist.org/packages/liamdennehy/http-signatures-php) to your [`composer.json`](https://getcomposer.org/).

- A message is assumed to be a PSR-7 compatible Request or Response.
- A `Context` object is used to configure the signature parameters, and prepare the verifier functionality.
- The `signWithDigest` function witll add a `Digest` header and digitally sign the message in a new `Signature` header.

Signing a PSR-7 request `$message` before sending:

```
  use HttpSignatures\Context;

  $context = new HttpSignatures\Context([
    'keys' => ['mykey' => file_get_contents('/path/to/privatekeyfile')],
    'algorithm' => 'rsa-sha256',
    'headers' => ['(request-target)', 'Date'],
  ]);

  $context->signer()->signWithDigest($message);
```

Complete documentation for this library for other ose cases can be found at [Read The Docs](https://http-signatures-php.readthedocs.io/en/latest/)

Contributing
------------

[](#contributing)

Pull Requests are welcome, as are [issue reports](https://github.com/liamdennehy/http-signatures-php/issues) if you encounter any problems.

**Note**: Due to composer dependencies for the reference implementation `composer install` prior to local development is only posible on PHP 7.1, or by manually removing the incompatible dependencies using the command (wrapped for readability):

```
  composer remove --dev \
  nyholm/psr7 nyholm/psr7-server riswallsmith/buzz \
  endframework/zend-httphandlerrunner
```

License
-------

[](#license)

HTTP Signatures PHP library is licensed under [The MIT License (MIT)](https://opensource.org/licenses/MIT).

Documentation of the library is licensed under [Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)](https://creativecommons.org/licenses/by-sa/4.0/)

Details are in the [LICENSE file](./LICENSE.md)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 71.9% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/48ce15d46f86b7e95cdf6885d04dfdb9e633e72e80b4f9924fb20c0e39153c28?d=identicon)[rivervanrain](/maintainers/rivervanrain)

---

Top Contributors

[![liamdennehy](https://avatars.githubusercontent.com/u/4996358?v=4)](https://github.com/liamdennehy "liamdennehy (282 commits)")[![pda](https://avatars.githubusercontent.com/u/15759?v=4)](https://github.com/pda "pda (54 commits)")[![navitronic](https://avatars.githubusercontent.com/u/180519?v=4)](https://github.com/navitronic "navitronic (24 commits)")[![mtibben](https://avatars.githubusercontent.com/u/980499?v=4)](https://github.com/mtibben "mtibben (16 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (6 commits)")[![rubensayshi](https://avatars.githubusercontent.com/u/649160?v=4)](https://github.com/rubensayshi "rubensayshi (5 commits)")[![markharding](https://avatars.githubusercontent.com/u/851436?v=4)](https://github.com/markharding "markharding (1 commits)")[![harto](https://avatars.githubusercontent.com/u/103448?v=4)](https://github.com/harto "harto (1 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (1 commits)")[![vektah](https://avatars.githubusercontent.com/u/2247982?v=4)](https://github.com/vektah "vektah (1 commits)")[![feenx](https://avatars.githubusercontent.com/u/9256168?v=4)](https://github.com/feenx "feenx (1 commits)")

### Embed Badge

![Health badge](/badges/rivervanrain-http-signatures-php/health.svg)

```
[![Health](https://phpackages.com/badges/rivervanrain-http-signatures-php/health.svg)](https://phpackages.com/packages/rivervanrain-http-signatures-php)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M291](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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