PHPackages                             namshi/jose - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. namshi/jose

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

namshi/jose
===========

JSON Object Signing and Encryption library for PHP.

7.2.3(9y ago)1.8k99.6M—8.3%131[9 issues](https://github.com/namshi/jose/issues)[3 PRs](https://github.com/namshi/jose/pulls)20MITPHPPHP &gt;=5.5

Since Jun 3Pushed 4y ago61 watchersCompare

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

READMEChangelogDependencies (4)Versions (67)Used By (20)Security (2)

NAMSHI | JOSE
=============

[](#namshi--jose)

Deprecation notice
------------------

[](#deprecation-notice)

> Hi there,
>
> as much as we'd like to be able to work on all of the OSS in the world, we don't actively use this library anymore This means that new features / bugfixes / etc will only be merged based on pull requests from external contributors, and we strongly recommend you look for a long-term alternative.
>
> If you're looking for an actively maintained library check [firebase/php-jwt](https://github.com/firebase/php-jwt) out!

[![Build Status](https://camo.githubusercontent.com/a9b08dee5dcfda2415ee91297a3086f7c390a05ef7a8caf4ec0e6fa6fb8e51aa/68747470733a2f2f7472617669732d63692e6f72672f6e616d7368692f6a6f73652e737667)](https://travis-ci.org/namshi/jose)[![Latest Stable Version](https://camo.githubusercontent.com/4f50bb4a1d63e00fd244b43f20244306042d4f89f9f9d88877db8865a000ab82/68747470733a2f2f706f7365722e707567782e6f72672f6e616d7368692f6a6f73652f762f737461626c65)](https://packagist.org/packages/namshi/jose)[![Total Downloads](https://camo.githubusercontent.com/c40be85ab598853e6ec87f04799dd4904d2c0645bd8da4236b4efee9c76db20d/68747470733a2f2f706f7365722e707567782e6f72672f6e616d7368692f6a6f73652f646f776e6c6f616473)](https://packagist.org/packages/namshi/jose)[![License](https://camo.githubusercontent.com/cc20d3883a7b851c397097bca2db164b163e530343cdf2e4b9e9f617856efdd7/68747470733a2f2f706f7365722e707567782e6f72672f6e616d7368692f6a6f73652f6c6963656e7365)](https://packagist.org/packages/namshi/jose)

This library provides a lightweight implementation of the JWS ([JSON Web Signature](http://tools.ietf.org/html/draft-jones-json-web-signature-04)) specification.

Prerequisites
-------------

[](#prerequisites)

This library needs PHP 5.5+ and the library OpenSSL.

It has been tested using `PHP5.5` to `PHP7.0` and `HHVM`.

Installation
------------

[](#installation)

You can install the library directly from composer / [packagist](https://packagist.org/packages/namshi/jose):

```
"namshi/jose": "7.0.*"

```

Usage
-----

[](#usage)

Using it is pretty straightforward: imagine that you want to offer a service the ability to authenticate a user via a cookie, and the service is built with javascript; what you would need to do is to generate a JWS (after verifying the credentials once), store it as a cookie and then pass it from your JavaScript app everytime you want to authenticate that user.

First, generate the JWS:

```
