Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #107 from shama/coresecurity

Adding content to the Security Core Utility docs
  • Loading branch information...
commit 9186f33860127660ef6a88580db8b0dfd4a1f14e 2 parents 010963e + 7f119f6
@markstory markstory authored
Showing with 69 additions and 1 deletion.
  1. +69 −1 en/core-utility-libraries/security.rst
View
70 en/core-utility-libraries/security.rst
@@ -5,6 +5,74 @@ The `security library <http://api.cakephp.org/class/security>`_
handles basic security measures such as providing methods for
hashing and encrypting data.
+Security API
+============
+
+.. php:class:: Security
+
+
+.. php:staticmethod:: cipher( $text, $key )
+
+ :rtype: string
+
+ Encrypts/Decrypts a text using the given key.::
+
+ <?php
+ // Encrypt your secret password with my_key
+ $secret = Security::cipher('my secret password', 'my_key');
+
+ // Later decrypt your secret password
+ $nosecret = Security::cipher($secret, 'my_key');
+
+
+.. php:staticmethod:: generateAuthKey( )
+
+ :rtype: string
+
+ Generate authorization hash.
+
+
+.. php:staticmethod:: getInstance( )
+
+ :rtype: object
+
+ Singleton implementation to get object instance.
+
+
+.. php:staticmethod:: hash( $string, $type = NULL, $salt = false )
+
+ :rtype: string
+
+ Create a hash from string using given method. Fallback on next
+ available method.
+
+
+.. php:staticmethod:: inactiveMins( )
+
+ :rtype: integer
+
+ Get allowed minutes of inactivity based on security level.::
+
+ <?php
+ $mins = Security::inactiveMins();
+ // If your config Security.level is set to 'medium' then $mins will equal 100
+
+
+.. php:staticmethod:: setHash( $hash )
+
+ :rtype: void
+
+ Sets the default hash method for the Security object. This
+ affects all objects using Security::hash().
+
+
+.. php:staticmethod:: validateAuthKey( $authKey )
+
+ :rtype: boolean
+
+ Validate authorization hash.
+
+
.. todo::
- There is no content here :(
+ Add more examples :|
Please sign in to comment.
Something went wrong with that request. Please try again.