PHPackages                             uma/psr7-hmac - 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. uma/psr7-hmac

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

uma/psr7-hmac
=============

An HMAC authentication library built on top of the PSR-7 specification

v1.0.0(5y ago)2348.0k↓47.1%2[3 issues](https://github.com/1ma/Psr7Hmac/issues)2MITPHPPHP ^7.3.0 || ^7.4.0 || ^8.0.0

Since May 28Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/1ma/Psr7Hmac)[ Packagist](https://packagist.org/packages/uma/psr7-hmac)[ Docs](https://github.com/1ma/Psr7Hmac)[ RSS](/packages/uma-psr7-hmac/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (13)Versions (12)Used By (2)

Psr7Hmac
========

[](#psr7hmac)

An HMAC authentication library built on top of the PSR-7 specification.

[![.github/workflows/phpunit.yml](https://github.com/1ma/Psr7Hmac/workflows/.github/workflows/phpunit.yml/badge.svg)](https://github.com/1ma/Psr7Hmac/workflows/.github/workflows/phpunit.yml/badge.svg) [![Code Coverage](https://camo.githubusercontent.com/1ac2321bddc77d6238148962829abbed812de2ea5775833621b3d5c65481eb4d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f316d612f50737237486d61632f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/1ma/Psr7Hmac/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/f9023f7fa3b3d8ca7d845daa4c8b1d392e9306797ff61c2c0056a0285f946ca6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f316d612f50737237486d61632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/1ma/Psr7Hmac/?branch=master) [![Total Downloads](https://camo.githubusercontent.com/4cf53d160820851a3df33020082f2d6d6548aeff10539b6b89853475831d711f/68747470733a2f2f706f7365722e707567782e6f72672f756d612f707372372d686d61632f646f776e6c6f616473)](https://packagist.org/packages/uma/psr7-hmac)

Releases
--------

[](#releases)

[![Latest Stable Version](https://camo.githubusercontent.com/57da31af6096d5f4e02658b952c50c2ef4295d3dcf77b6b6b7e13fcd6e548665/68747470733a2f2f706f7365722e707567782e6f72672f756d612f707372372d686d61632f762f737461626c65)](https://packagist.org/packages/uma/psr7-hmac)

> If you want to build an HMAC-authenticated API based on Symfony check out [UMAPsr7HmacBundle](https://github.com/1ma/UMAPsr7HmacBundle), which provides a convenient integration of this library with Symfony's [Security Component](http://symfony.com/doc/current/components/security.html).

Library API
-----------

[](#library-api)

```
/**
 * @param string $secret
 */
Signer::__construct($secret);

/**
 * @param RequestInterface $request
 *
 * @return RequestInterface
 */
Signer::sign(RequestInterface $request);

/**
 * @param InspectorInterface|null $inspector
 */
Verifier::__construct(InspectorInterface $inspector = null);

/**
 * @param RequestInterface $request
 * @param string           $secret
 *
 * @return bool
 */
Verifier::verify(RequestInterface $request, $secret);
```

Demo Script
-----------

[](#demo-script)

```
