コード例 #1
0
ファイル: EncryptionTest.php プロジェクト: RepoMon/tokens
 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);
 }
コード例 #2
0
ファイル: Redis.php プロジェクト: RepoMon/tokens
 /**
  * @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());
     }
 }
コード例 #3
0
ファイル: Memory.php プロジェクト: RepoMon/tokens
 /**
  * @param $key
  */
 public function add($key, $value)
 {
     $this->data[$key] = $this->encryption->encrypt($value);
 }