diff options
author | xue <> | 2006-09-03 21:33:04 +0000 |
---|---|---|
committer | xue <> | 2006-09-03 21:33:04 +0000 |
commit | a90da4361d02a53204f198f19072e2d420b394f0 (patch) | |
tree | ecf9a1990fe1ffb9c9df405123c0e68504ecf8bb /framework/Security/TSecurityManager.php | |
parent | a55994488789e9c481aab5e3e49b15bd9718afc1 (diff) |
Added TEnumerable and updated places where enumerable type should be used.
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..6c227c8e 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::ensureEnumerable($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 |