getEncryptionKey() public method

public getEncryptionKey ( ) : string
return string the private key used to encrypt/decrypt data. If the key is not explicitly set, a random one is generated and returned.
Ejemplo n.º 1
0
 public function testEncryptionKey()
 {
     $sec = new TSecurityManager();
     $sec->init(null);
     // Random encryption key
     $valkey = $sec->getEncryptionKey();
     self::assertEquals($valkey, self::$app->getGlobalState(TSecurityManager::STATE_ENCRYPTION_KEY));
     $sec->setEncryptionKey('aKey');
     self::assertEquals('aKey', $sec->getEncryptionKey());
     try {
         $sec->setEncryptionKey('');
         self::fail('Expected TInvalidDataValueException not thrown');
     } catch (TInvalidDataValueException $e) {
     }
 }