diff options
author | xue <> | 2006-09-04 19:15:47 +0000 |
---|---|---|
committer | xue <> | 2006-09-04 19:15:47 +0000 |
commit | 56fee292c37e162c03fab9eeadd6a8b9ab85c251 (patch) | |
tree | 923510b93c707868098ae4e5f404eb3766a59553 /framework/Security/TSecurityManager.php | |
parent | b107cad91733d4a2a80f42cdbaab41a4f7b41c9d (diff) |
merge from 3.0 branch till 1387
Diffstat (limited to 'framework/Security/TSecurityManager.php')
-rw-r--r-- | framework/Security/TSecurityManager.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php index b0ea4e95..89f3711a 100644 --- a/framework/Security/TSecurityManager.php +++ b/framework/Security/TSecurityManager.php @@ -43,11 +43,9 @@ class TSecurityManager extends TModule {
const STATE_VALIDATION_KEY='prado:securitymanager:validationkey';
const STATE_ENCRYPTION_KEY='prado:securitymanager:encryptionkey';
- const STATE_INIT_VECTOR='prado:securitymanager:initvector';
private $_validationKey=null;
private $_encryptionKey=null;
- private $_initVector=null;
- private $_validation='SHA1';
+ private $_validation=TSecurityManagerValidationMode::SHA1;
private $_encryption='3DES';
/**
@@ -127,7 +125,7 @@ class TSecurityManager extends TModule }
/**
- * @return string hashing algorithm used to generate HMAC. Defaults to 'SHA1'.
+ * @return TSecurityManagerValidationMode hashing algorithm used to generate HMAC. Defaults to TSecurityManagerValidationMode::SHA1.
*/
public function getValidation()
{
@@ -135,11 +133,11 @@ class TSecurityManager extends TModule }
/**
- * @param string hashing algorithm used to generate HMAC. Valid values include 'SHA1' and 'MD5'.
+ * @param TSecurityManagerValidationMode hashing algorithm used to generate HMAC.
*/
public function setValidation($value)
{
- $this->_validation=TPropertyValue::ensureEnum($value,'SHA1','MD5');
+ $this->_validation=TPropertyValue::ensureEnum($value,'TSecurityManagerValidationMode');
}
/**
@@ -260,4 +258,25 @@ class TSecurityManager extends TModule }
}
+
+/**
+ * TSecurityManagerValidationMode class.
+ * TSecurityManagerValidationMode defines the enumerable type for the possible validation modes
+ * that can be used by {@link TSecurityManager}.
+ *
+ * The following enumerable values are defined:
+ * - MD5: an MD5 hash is generated from the data and used for validation.
+ * - SHA1: an SHA1 hash is generated from the data and used for validation.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Revision: $ $Date: $
+ * @package System.Security
+ * @since 3.0.4
+ */
+class TSecurityManagerValidationMode extends TEnumerable
+{
+ const MD5='MD5';
+ const SHA1='SHA1';
+}
+
?>
\ No newline at end of file |