Permalink
Browse files

Crypt_RSA 1.1.0b

git-svn-id: http://svn.php.net/repository/pear/packages/Crypt_RSA/trunk@232767 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
cweiske committed Mar 27, 2007
1 parent 5194199 commit 9e7045aa51758bafd56e85b426a9185b1dc0855d
Showing with 535 additions and 337 deletions.
  1. +1 −1 LICENSE
  2. +7 −11 RSA.php
  3. +2 −4 RSA/ErrorHandler.php
  4. +6 −10 RSA/Key.php
  5. +258 −38 RSA/KeyPair.php
  6. +26 −38 RSA/Math/BCMath.php
  7. +15 −28 RSA/Math/BigInt.php
  8. +26 −38 RSA/Math/GMP.php
  9. +3 −5 RSA/MathLoader.php
  10. +3 −4 docs/math_wrappers.txt
  11. +2 −4 examples/web_interface.php
  12. +145 −144 package.xml
  13. +39 −8 tests/test1.php
  14. +2 −4 tests/test2.php
View
@@ -1,4 +1,4 @@
-Copyright 2005 Alexander Valyalkin
+Copyright 2005, 2006 Alexander Valyalkin
LICENSE: This source file is subject to version 3.0 of the PHP license
that is available through the world-wide-web at the following URI:
View
18 RSA.php
@@ -1,6 +1,4 @@
<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
/**
* Crypt_RSA allows to do following operations:
* - key pair generation
@@ -18,9 +16,9 @@
* @category Encryption
* @package Crypt_RSA
* @author Alexander Valyalkin <valyala@gmail.com>
- * @copyright 2005 Alexander Valyalkin
+ * @copyright 2005, 2006 Alexander Valyalkin
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version 1.0.0
+ * @version 1.1.0
* @link http://pear.php.net/package/Crypt_RSA
*/
@@ -62,7 +60,7 @@
* $key_pair = new Crypt_RSA_KeyPair(1024);
*
* // check consistence of Crypt_RSA_KeyPair object
- * $error_handler($rsa_obj);
+ * $error_handler($key_pair);
*
* // creating Crypt_RSA object
* $rsa_obj = new Crypt_RSA;
@@ -110,7 +108,7 @@
* @category Encryption
* @package Crypt_RSA
* @author Alexander Valyalkin <valyala@gmail.com>
- * @copyright 2005 Alexander Valyalkin
+ * @copyright 2005, 2006 Alexander Valyalkin
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Crypt_RSA
* @version @package_version@
@@ -176,13 +174,11 @@ class Crypt_RSA extends Crypt_RSA_ErrorHandler
* enc_key, dec_key, private_key, public_key, hash_func.
* See setParams() method for more detailed description of
* these parameters.
- *
* @param string $wrapper_name
* Name of math wrapper, which will be used to
* perform different operations with big integers.
* See contents of Crypt/RSA/Math folder for examples of wrappers.
* Read docs/Crypt_RSA/docs/math_wrappers.txt for details.
- *
* @param string $error_handler name of error handler function
*
* @access public
@@ -217,19 +213,19 @@ function Crypt_RSA($params = null, $wrapper_name = 'default', $error_handler = '
* enc_key, dec_key, private_key, public_key, hash_func.
* See setParams() method for more detailed description of
* these parameters.
- *
* @param string $wrapper_name
* Name of math wrapper, which will be used to
* perform different operations with big integers.
* See contents of Crypt/RSA/Math folder for examples of wrappers.
* Read docs/Crypt_RSA/docs/math_wrappers.txt for details.
+ * @param string $error_handler name of error handler function
*
* @return object new Crypt_RSA object on success or PEAR_Error object on failure
* @access public
*/
- function &factory($params = null, $wrapper_name = 'default')
+ function &factory($params = null, $wrapper_name = 'default', $error_handler = '')
{
- $obj = &new Crypt_RSA($params, $wrapper_name);
+ $obj = &new Crypt_RSA($params, $wrapper_name, $error_handler);
if ($obj->isError()) {
// error during creating a new object. Retrurn PEAR_Error object
return $obj->getLastError();
View
@@ -1,6 +1,4 @@
<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
/**
* Crypt_RSA allows to do following operations:
* - key pair generation
@@ -18,9 +16,9 @@
* @category Encryption
* @package Crypt_RSA
* @author Alexander Valyalkin <valyala@gmail.com>
- * @copyright 2005 Alexander Valyalkin
+ * @copyright 2005, 2006 Alexander Valyalkin
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version 1.0.0
+ * @version 1.1.0
* @link http://pear.php.net/package/Crypt_RSA
*/
View
@@ -1,6 +1,4 @@
<?php
-/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
-
/**
* Crypt_RSA allows to do following operations:
* - key pair generation
@@ -18,9 +16,9 @@
* @category Encryption
* @package Crypt_RSA
* @author Alexander Valyalkin <valyala@gmail.com>
- * @copyright 2005 Alexander Valyalkin
+ * @copyright 2005, 2006 Alexander Valyalkin
* @license http://www.php.net/license/3_0.txt PHP License 3.0
- * @version 1.0.0
+ * @version 1.1.0
* @link http://pear.php.net/package/Crypt_RSA
*/
@@ -88,7 +86,7 @@
* @category Encryption
* @package Crypt_RSA
* @author Alexander Valyalkin <valyala@gmail.com>
- * @copyright 2005 Alexander Valyalkin
+ * @copyright 2005, 2006 Alexander Valyalkin
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @link http://pear.php.net/package/Crypt_RSA
* @version @package_version@
@@ -143,13 +141,11 @@ class Crypt_RSA_Key extends Crypt_RSA_ErrorHandler
* @param string $modulus key modulus
* @param string $exp key exponent
* @param string $key_type type of the key (public or private)
- *
* @param string $wrapper_name
* Name of math wrapper, which will be used to
* perform different operations with big integers.
* See contents of Crypt/RSA/Math folder for examples of wrappers.
* Read docs/Crypt_RSA/docs/math_wrappers.txt for details.
- *
* @param string $error_handler name of error handler function
*
* @access public
@@ -196,19 +192,19 @@ function Crypt_RSA_Key($modulus, $exp, $key_type, $wrapper_name = 'default', $er
* @param string $modulus key modulus
* @param string $exp key exponent
* @param string $key_type type of the key (public or private)
- *
* @param string $wrapper_name
* Name of math wrapper, which will be used to
* perform different operations with big integers.
* See contents of Crypt/RSA/Math folder for examples of wrappers.
* Read docs/Crypt_RSA/docs/math_wrappers.txt for details.
+ * @param string $error_handler name of error handler function
*
* @return object new Crypt_RSA_Key object on success or PEAR_Error object on failure
* @access public
*/
- function &factory($modulus, $exp, $key_type, $wrapper_name = 'default')
+ function &factory($modulus, $exp, $key_type, $wrapper_name = 'default', $error_handler = '')
{
- $obj = &new Crypt_RSA_Key($modulus, $exp, $key_type, $wrapper_name);
+ $obj = &new Crypt_RSA_Key($modulus, $exp, $key_type, $wrapper_name, $error_handler);
if ($obj->isError()) {
// error during creating a new object. Retrurn PEAR_Error object
return $obj->getLastError();
Oops, something went wrong.

0 comments on commit 9e7045a

Please sign in to comment.