2017 © Pedro Peláez
 

library doctrine-encryption-extension

Doctrine2 encryption extension

image

ywh/doctrine-encryption-extension

Doctrine2 encryption extension

  • Wednesday, June 6, 2018
  • by yeswehack
  • Repository
  • 2 Watchers
  • 0 Stars
  • 197 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 54 % Grown

The README.md

Doctrine2 encryption extension

This extension allows to encrypt entites fields using php-encryption., (*1)

This extension is based on and use Doctrine2 behavioral extensions., (*2)

Setup and autoloading

Read the documentation or check the example code on how to setup and use the extensions in most optimized way., (*3)

Encryptable Entity example:

Encryptable annotations:

  1. @YWH\Encryptable\Mapping\Annotation\Encryptable this class annotation tells if a class is Encryptable. Available configuration options:
    • usePassword does the key is protected with a password ? Default: true
  2. @YWH\Encryptable\Mapping\Annotation\EncryptionKey this annotation tells that this column will contain the encryption key use to encrypt data. Only necessary when using a key protected by password
  3. @YWH\Encryptable\Mapping\Annotation\Encrypted this annotation tells that this column will be encrypted. Available configuration options:
    • type the data type. Should one of the valid doctrine types Default: string

Notes about setting the encryption key and encrypted data columns:

EncryptionKey and Encrypted columns must be set as string type, (*4)

``` php /** * @var string * * @ORM\Column(name="encryption_key", type="text") * @YWH\EncryptionKey() */ private $encryptionKey;, (*5)

/**
 * @ORM\Column(name="encrypted_data", type="string")
 * @YWH\Encrypted()
 */
private $encryptedData;

``` php <?php namespace Entity; use Doctrine\ORM\Mapping as ORM; use YWH\Encryptable\Mapping\Annotation as YWH; /** * @ORM\Entity * @YWH\Encryptable(usePassword=true) */ class Article { /** @ORM\Id @ORM\GeneratedValue @ORM\Column(type="integer") */ private $id; /** * @var string * * @ORM\Column(name="encryption_key", type="text") * @YWH\EncryptionKey() */ private $encryptionKey; /** * @ORM\Column(type="string", length=128) * @YWH\Encrypted() */ private $title; /** * @ORM\Column(name="date", type="string") * @YWH\Encrypted(type="datetime") */ private $date; public function getId() { return $this->id; } public function setEncryptionKey($key) { $this->encryptionKey = $key; } public function getEncryptionKey() { return $this->encryptionKey; } public function setTitle($title) { $this->title = $title; } public function getTitle() { return $this->title; } public function setDate(\DateTime $date) { $this->date = $date; } public function getDate() { return $this->date; } }

The Versions

06/06 2018

dev-master

9999999-dev

Doctrine2 encryption extension

  Sources   Download

MIT

The Requires

 

The Development Requires

by Romain Honel
by Maxime Bouchard

extension encryption doctrine2 behaviors defuse ywh yeswehack

06/06 2018

dev-develop

dev-develop

Doctrine2 encryption extension

  Sources   Download

MIT

The Requires

 

The Development Requires

by Romain Honel
by Maxime Bouchard

extension encryption doctrine2 behaviors defuse ywh yeswehack

06/06 2018

1.1

1.1.0.0

Doctrine2 encryption extension

  Sources   Download

MIT

The Requires

 

The Development Requires

by Romain Honel
by Maxime Bouchard

extension encryption doctrine2 behaviors defuse ywh yeswehack

12/01 2018

1.0

1.0.0.0

Doctrine2 encryption extension

  Sources   Download

MIT

The Requires

 

The Development Requires

by Romain Honel
by Maxime Bouchard

extension encryption doctrine2 behaviors defuse ywh yeswehack