PHPackages                             pierotto/tokenizer-bundle - 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. pierotto/tokenizer-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

pierotto/tokenizer-bundle
=========================

The package is used for secure data exchange between two parties using a JWT token.

2.0.0(1y ago)012MITPHPPHP &gt;=8.3

Since Jul 21Pushed 1y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (9)Versions (5)Used By (0)

Tokenizer Bundle
================

[](#tokenizer-bundle)

A lightweight Symfony bundle for encoding and decoding data using JWT.
It allows secure, structured communication between services or systems using tokenized data.

Requirements
------------

[](#requirements)

- PHP 8.3+
- Symfony 7.0+

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

[](#installation)

Install the bundle via Composer:

```
composer require pierotto/tokenizer-bundle
```

Register the bundle (if using Symfony without Flex):

```
// bundles.php
return [
    Pierotto\TokenizerBundle\Infrastructure\Symfony\TokenizerBundle::class => ['all' => true],
];
```

Configuration
-------------

[](#configuration)

Add the following configuration to your `config/packages/tokenizer.yaml`:

```
tokenizer:
    algorithm: 'RS256'
    private_key: '%kernel.project_dir%/config/keys/private.key'
    public_key: '%kernel.project_dir%/config/keys/public.key'
    passphrase: 'abcd123'
```

Key generation
--------------

[](#key-generation)

Generate a private and public key pair using the console command:

```
php bin/console tokenizer:generate:keys
```

Usage
-----

[](#usage)

Start by implementing the `\Pierotto\TokenizerBundle\Tokenizer\TokenInterface`.
This object represents the data that will be encoded into a token.

```
