Installation

Before starting installation, your application must have PHP 7.2 minimum. This bundle use Sapient library which require libsodium extension. Symfony 3.4 and Synfony 4 are supported.

Symfony 4 with recipe

A recipe has been created for this bundle.

Enable contrib repository in composer.

composer config extra.symfony.allow-contrib true
composer install lepiaf/sapient-bundle

By default, recipe will enable and generate a minimal config file. You have to run a command to initialize configuration.

bin/console sapient:configure

It will output configuration. Copy and paste it to config/packages/sapient.yml

sapient:
    sign:
        public: 'signing-key-public'
        private: 'signing-key-private'
        name: 'signer-name'
    seal:
        public: 'seal-key-public'
        private: 'seal-key-private'
    sealing_public_keys: ~
    verifying_public_keys: ~

Now your api is ready. Repeat this process with a client.

Symfony 4 without recipe

As usual, install it via composer

composer install lepiaf/sapient-bundle

Enable it in config/bundles.yml

<?php

return [
    lepiaf\SapientBundle\SapientBundle::class => ['all' => true],
];

Now bundle is registered. You can run command to generate default configuration.

bin/console sapient:configure

It will output configuration. Copy and paste it to config/packages/sapient.yml

sapient:
    sign:
        public: 'signing-key-public'
        private: 'signing-key-private'
        name: 'signer-name'
    seal:
        public: 'seal-key-public'
        private: 'seal-key-private'
    sealing_public_keys: ~
    verifying_public_keys: ~

Now your api is ready. Repeat this process with a client.

Symfony 3.4 without recipe

PHP 7.2 is the only requirement, it can work with symfony 3.4 and below.

Install it via composer

composer install lepiaf/sapient-bundle

Enable bundle in app/AppKernel.php

<?php

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new lepiaf\SapientBundle\SapientBundle()
        );

        return $bundles;
    }
}

Now bundle is registered. You can run command to generate default configuration.

bin/console sapient:configure

It will output configuration. Copy and paste it to app/config/config.yml

sapient:
    sign:
        public: 'signing-key-public'
        private: 'signing-key-private'
        name: 'signer-name'
    seal:
        public: 'seal-key-public'
        private: 'seal-key-private'
    sealing_public_keys: ~
    verifying_public_keys: ~

Now your api is ready. Repeat this process with a client.