dev-master
9999999-devDoctrine mapping type to store encrypted objects
MIT
The Requires
by Anton Eremin
                         Wallogit.com
                    
                    2017 © Pedro Peláez
                    
                    
                    
                    
                
                
            
Doctrine mapping type to store encrypted objects
This bundle implement a doctrine mapping type for objects, that should be encrypted in storage., (*1)
The bundle can be installed with composer:, (*2)
composer require jfnetwork/doctrine-encrypted-object
For Sodium or Openssl encryption are corresponding PHP extensions required. For Defuse is defuse/php-encryption package required, (*3)
you should provide two environment variables:, (*4)
DOCTRINE_ENCRYPTED_OBJECT_KEY=xxx DOCTRINE_ENCRYPTED_OBJECT_ENCRYPTION_WAY=sodium
The DOCTRINE_ENCRYPTED_OBJECT_ENCRYPTION_WAY variable is optional and has value sodium by default., (*5)
The DOCTRINE_ENCRYPTED_OBJECT_KEY variable should be generated with the command:, (*6)
bin/console jf:doctrine-encrypted-object:create-key {encryption_way}
where encryption way is one of sodium, openssl, defuse, (*7)
/** * @ORM\Column(name="your_secure_field", type="encoded_object") */ private $yourSecureField;
use Jfnetwork\DoctrineEncryptedObject\DoctrineEncryptedObject; #[ORM\Column(type: DoctrineEncryptedObject::TYPE_NAME)] private $yourSecureField;
You should set DOCTRINE_ENCRYPTED_OBJECT_ENCRYPTION_WAY environment variable to defuse. No other configuration is required. Some migration tool to other encryption ways will be provided later., (*8)
Doctrine mapping type to store encrypted objects
MIT