Exemple #1
0
 public function testEncryptGeneratesDifferentStringsForSameValue()
 {
     $string = 'my big fat secret';
     $encrypted_1 = $this->encryption->encrypt($string);
     $encrypted_2 = $this->encryption->encrypt($string);
     $this->assertFalse($encrypted_1 == $encrypted_2);
 }
Exemple #2
0
 /**
  * @param $key
  * @param $value
  * @throws UnavailableException
  */
 public function add($key, $value)
 {
     // encrypt the tokens before storing in redis
     try {
         $this->client->set($key, $this->encryption->encrypt($value));
     } catch (ServerException $ex) {
         throw new UnavailableException($ex->getMessage());
     }
 }
Exemple #3
0
 /**
  * @param $key
  */
 public function add($key, $value)
 {
     $this->data[$key] = $this->encryption->encrypt($value);
 }