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 17... Line 17...
17
 *
17
 *
18
 * Also, technically, PKCS1 decribes RSA but I am not aware of a formal specification for DSA.
18
 * Also, technically, PKCS1 decribes RSA but I am not aware of a formal specification for DSA.
19
 * The DSA private key format seems to have been adapted from the RSA private key format so
19
 * The DSA private key format seems to have been adapted from the RSA private key format so
20
 * we're just re-using that as the name.
20
 * we're just re-using that as the name.
21
 *
21
 *
-
 
22
 * @category  Crypt
-
 
23
 * @package   DSA
22
 * @author    Jim Wigginton <terrafrost@php.net>
24
 * @author    Jim Wigginton <terrafrost@php.net>
23
 * @copyright 2015 Jim Wigginton
25
 * @copyright 2015 Jim Wigginton
24
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
26
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
25
 * @link      http://phpseclib.sourceforge.net
27
 * @link      http://phpseclib.sourceforge.net
26
 */
28
 */
Line 34... Line 36...
34
use phpseclib3\Math\BigInteger;
36
use phpseclib3\Math\BigInteger;
35
 
37
 
36
/**
38
/**
37
 * PKCS#1 Formatted DSA Key Handler
39
 * PKCS#1 Formatted DSA Key Handler
38
 *
40
 *
-
 
41
 * @package RSA
39
 * @author  Jim Wigginton <terrafrost@php.net>
42
 * @author  Jim Wigginton <terrafrost@php.net>
-
 
43
 * @access  public
40
 */
44
 */
41
abstract class PKCS1 extends Progenitor
45
abstract class PKCS1 extends Progenitor
42
{
46
{
43
    /**
47
    /**
44
     * Break a public or private key down into its constituent components
48
     * Break a public or private key down into its constituent components
45
     *
49
     *
-
 
50
     * @access public
46
     * @param string $key
51
     * @param string $key
47
     * @param string $password optional
52
     * @param string $password optional
48
     * @return array
53
     * @return array
49
     */
54
     */
50
    public static function load($key, $password = '')
55
    public static function load($key, $password = '')
Line 75... Line 80...
75
    }
80
    }
76
 
81
 
77
    /**
82
    /**
78
     * Convert DSA parameters to the appropriate format
83
     * Convert DSA parameters to the appropriate format
79
     *
84
     *
-
 
85
     * @access public
80
     * @param \phpseclib3\Math\BigInteger $p
86
     * @param \phpseclib3\Math\BigInteger $p
81
     * @param \phpseclib3\Math\BigInteger $q
87
     * @param \phpseclib3\Math\BigInteger $q
82
     * @param \phpseclib3\Math\BigInteger $g
88
     * @param \phpseclib3\Math\BigInteger $g
83
     * @return string
89
     * @return string
84
     */
90
     */
Line 98... Line 104...
98
    }
104
    }
99
 
105
 
100
    /**
106
    /**
101
     * Convert a private key to the appropriate format.
107
     * Convert a private key to the appropriate format.
102
     *
108
     *
-
 
109
     * @access public
103
     * @param \phpseclib3\Math\BigInteger $p
110
     * @param \phpseclib3\Math\BigInteger $p
104
     * @param \phpseclib3\Math\BigInteger $q
111
     * @param \phpseclib3\Math\BigInteger $q
105
     * @param \phpseclib3\Math\BigInteger $g
112
     * @param \phpseclib3\Math\BigInteger $g
106
     * @param \phpseclib3\Math\BigInteger $y
113
     * @param \phpseclib3\Math\BigInteger $y
107
     * @param \phpseclib3\Math\BigInteger $x
114
     * @param \phpseclib3\Math\BigInteger $x
Line 126... Line 133...
126
    }
133
    }
127
 
134
 
128
    /**
135
    /**
129
     * Convert a public key to the appropriate format
136
     * Convert a public key to the appropriate format
130
     *
137
     *
-
 
138
     * @access public
131
     * @param \phpseclib3\Math\BigInteger $p
139
     * @param \phpseclib3\Math\BigInteger $p
132
     * @param \phpseclib3\Math\BigInteger $q
140
     * @param \phpseclib3\Math\BigInteger $q
133
     * @param \phpseclib3\Math\BigInteger $g
141
     * @param \phpseclib3\Math\BigInteger $g
134
     * @param \phpseclib3\Math\BigInteger $y
142
     * @param \phpseclib3\Math\BigInteger $y
135
     * @return string
143
     * @return string