Subversion Repositories oidplus

Rev

Rev 846 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 846 Rev 874
Line 11... Line 11...
11
 *
11
 *
12
 * Technically, PKCS1 is for RSA keys, only, but we're using PKCS1 to describe
12
 * Technically, PKCS1 is for RSA keys, only, but we're using PKCS1 to describe
13
 * DSA, whose format isn't really formally described anywhere, so might as well
13
 * DSA, whose format isn't really formally described anywhere, so might as well
14
 * use it to describe this, too.
14
 * use it to describe this, too.
15
 *
15
 *
-
 
16
 * @category  Crypt
-
 
17
 * @package   DH
16
 * @author    Jim Wigginton <terrafrost@php.net>
18
 * @author    Jim Wigginton <terrafrost@php.net>
17
 * @copyright 2015 Jim Wigginton
19
 * @copyright 2015 Jim Wigginton
18
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
20
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
19
 * @link      http://phpseclib.sourceforge.net
21
 * @link      http://phpseclib.sourceforge.net
20
 */
22
 */
Line 27... Line 29...
27
use phpseclib3\Math\BigInteger;
29
use phpseclib3\Math\BigInteger;
28
 
30
 
29
/**
31
/**
30
 * "PKCS1" Formatted DH Key Handler
32
 * "PKCS1" Formatted DH Key Handler
31
 *
33
 *
-
 
34
 * @package DH
32
 * @author  Jim Wigginton <terrafrost@php.net>
35
 * @author  Jim Wigginton <terrafrost@php.net>
-
 
36
 * @access  public
33
 */
37
 */
34
abstract class PKCS1 extends Progenitor
38
abstract class PKCS1 extends Progenitor
35
{
39
{
36
    /**
40
    /**
37
     * Break a public or private key down into its constituent components
41
     * Break a public or private key down into its constituent components
38
     *
42
     *
-
 
43
     * @access public
39
     * @param string $key
44
     * @param string $key
40
     * @param string $password optional
45
     * @param string $password optional
41
     * @return array
46
     * @return array
42
     */
47
     */
43
    public static function load($key, $password = '')
48
    public static function load($key, $password = '')
Line 58... Line 63...
58
    }
63
    }
59
 
64
 
60
    /**
65
    /**
61
     * Convert EC parameters to the appropriate format
66
     * Convert EC parameters to the appropriate format
62
     *
67
     *
-
 
68
     * @access public
63
     * @return string
69
     * @return string
64
     */
70
     */
65
    public static function saveParameters(BigInteger $prime, BigInteger $base, array $options = [])
71
    public static function saveParameters(BigInteger $prime, BigInteger $base, array $options = [])
66
    {
72
    {
67
        $params = [
73
        $params = [