diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-04-16 17:00:08 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-04-16 17:00:08 +0200 |
commit | 7644950b48b094bfe5675348aefb7cf5747d325b (patch) | |
tree | a1792e21239a86f471da99b454134a5d8533ef77 /lib/public/security | |
parent | 8653da6c16597959c7bd0f0b202747ff96204575 (diff) | |
download | nextcloud-server-7644950b48b094bfe5675348aefb7cf5747d325b.tar.gz nextcloud-server-7644950b48b094bfe5675348aefb7cf5747d325b.zip |
Add @since tags to all methods in public namespace
* enhance the app development experience - you can look up the
method introduction right inside the code without searching
via git blame
* easier to write apps for multiple versions
Diffstat (limited to 'lib/public/security')
-rw-r--r-- | lib/public/security/icrypto.php | 4 | ||||
-rw-r--r-- | lib/public/security/ihasher.php | 3 | ||||
-rw-r--r-- | lib/public/security/isecurerandom.php | 4 | ||||
-rw-r--r-- | lib/public/security/stringutils.php | 7 |
4 files changed, 18 insertions, 0 deletions
diff --git a/lib/public/security/icrypto.php b/lib/public/security/icrypto.php index 2b1c0bf8e4d..167baab8233 100644 --- a/lib/public/security/icrypto.php +++ b/lib/public/security/icrypto.php @@ -31,6 +31,7 @@ namespace OCP\Security; * $encryptWithCustomPassword = \OC::$server->getCrypto()->encrypt('EncryptedText', 'password'); * * @package OCP\Security + * @since 8.0.0 */ interface ICrypto { @@ -38,6 +39,7 @@ interface ICrypto { * @param string $message The message to authenticate * @param string $password Password to use (defaults to `secret` in config.php) * @return string Calculated HMAC + * @since 8.0.0 */ public function calculateHMAC($message, $password = ''); @@ -46,6 +48,7 @@ interface ICrypto { * @param string $plaintext * @param string $password Password to encrypt, if not specified the secret from config.php will be taken * @return string Authenticated ciphertext + * @since 8.0.0 */ public function encrypt($plaintext, $password = ''); @@ -55,6 +58,7 @@ interface ICrypto { * @param string $password Password to encrypt, if not specified the secret from config.php will be taken * @return string plaintext * @throws \Exception If the HMAC does not match + * @since 8.0.0 */ public function decrypt($authenticatedCiphertext, $password = ''); } diff --git a/lib/public/security/ihasher.php b/lib/public/security/ihasher.php index b06dd236077..14229ba99c1 100644 --- a/lib/public/security/ihasher.php +++ b/lib/public/security/ihasher.php @@ -40,6 +40,7 @@ namespace OCP\Security; * var_dump($newHash); * * @package OCP\Security + * @since 8.0.0 */ interface IHasher { /** @@ -49,6 +50,7 @@ interface IHasher { * * @param string $message Message to generate hash from * @return string Hash of the message with appended version parameter + * @since 8.0.0 */ public function hash($message); @@ -57,6 +59,7 @@ interface IHasher { * @param string $hash Assumed hash of the message * @param null|string &$newHash Reference will contain the updated hash if necessary. Update the existing hash with this one. * @return bool Whether $hash is a valid hash of $message + * @since 8.0.0 */ public function verify($message, $hash, &$newHash = null); } diff --git a/lib/public/security/isecurerandom.php b/lib/public/security/isecurerandom.php index 9a91a2f027a..69e6ec21b13 100644 --- a/lib/public/security/isecurerandom.php +++ b/lib/public/security/isecurerandom.php @@ -31,6 +31,7 @@ namespace OCP\Security; * $randomString = $rng->getMediumStrengthGenerator()->generateString(30); * * @package OCP\Security + * @since 8.0.0 */ interface ISecureRandom { @@ -50,6 +51,7 @@ interface ISecureRandom { * used as keys or salts. They are however useful for one-time use tokens. * * @return $this + * @since 8.0.0 */ public function getLowStrengthGenerator(); @@ -61,6 +63,7 @@ interface ISecureRandom { * take some time and resources to generate, so they should not be over-used * * @return $this + * @since 8.0.0 */ public function getMediumStrengthGenerator(); @@ -71,6 +74,7 @@ interface ISecureRandom { * specified all valid base64 characters are used. * @return string * @throws \Exception If the generator is not initialized. + * @since 8.0.0 */ public function generate($length, $characters = ''); } diff --git a/lib/public/security/stringutils.php b/lib/public/security/stringutils.php index bfe5820c758..4f41fcf8262 100644 --- a/lib/public/security/stringutils.php +++ b/lib/public/security/stringutils.php @@ -23,6 +23,12 @@ namespace OCP\Security; +/** + * Class StringUtils + * + * @package OCP\Security + * @since 8.0.0 + */ class StringUtils { /** * Compares whether two strings are equal. To prevent guessing of the string @@ -32,6 +38,7 @@ class StringUtils { * @param string $expected The expected value * @param string $input The input to compare against * @return bool True if the two strings are equal, otherwise false. + * @since 8.0.0 */ public static function equals($expected, $input) { return \OC\Security\StringUtils::equals($expected, $input); |