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 7... Line 7...
7
 * https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ elaborates.
7
 * https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ elaborates.
8
 * libsodium appears to use the same format as SUPERCOP.
8
 * libsodium appears to use the same format as SUPERCOP.
9
 *
9
 *
10
 * PHP version 5
10
 * PHP version 5
11
 *
11
 *
-
 
12
 * @category  Crypt
-
 
13
 * @package   EC
12
 * @author    Jim Wigginton <terrafrost@php.net>
14
 * @author    Jim Wigginton <terrafrost@php.net>
13
 * @copyright 2015 Jim Wigginton
15
 * @copyright 2015 Jim Wigginton
14
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
16
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
15
 * @link      http://phpseclib.sourceforge.net
17
 * @link      http://phpseclib.sourceforge.net
16
 */
18
 */
Line 22... Line 24...
22
use phpseclib3\Math\BigInteger;
24
use phpseclib3\Math\BigInteger;
23
 
25
 
24
/**
26
/**
25
 * libsodium Key Handler
27
 * libsodium Key Handler
26
 *
28
 *
-
 
29
 * @package EC
27
 * @author  Jim Wigginton <terrafrost@php.net>
30
 * @author  Jim Wigginton <terrafrost@php.net>
-
 
31
 * @access  public
28
 */
32
 */
29
abstract class libsodium
33
abstract class libsodium
30
{
34
{
31
    use Common;
35
    use Common;
32
 
36
 
33
    /**
37
    /**
34
     * Is invisible flag
38
     * Is invisible flag
35
     *
39
     *
-
 
40
     * @access private
36
     */
41
     */
37
    const IS_INVISIBLE = true;
42
    const IS_INVISIBLE = true;
38
 
43
 
39
    /**
44
    /**
40
     * Break a public or private key down into its constituent components
45
     * Break a public or private key down into its constituent components
41
     *
46
     *
-
 
47
     * @access public
42
     * @param string $key
48
     * @param string $key
43
     * @param string $password optional
49
     * @param string $password optional
44
     * @return array
50
     * @return array
45
     */
51
     */
46
    public static function load($key, $password = '')
52
    public static function load($key, $password = '')
Line 77... Line 83...
77
    }
83
    }
78
 
84
 
79
    /**
85
    /**
80
     * Convert an EC public key to the appropriate format
86
     * Convert an EC public key to the appropriate format
81
     *
87
     *
-
 
88
     * @access public
82
     * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
89
     * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
83
     * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
90
     * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
84
     * @return string
91
     * @return string
85
     */
92
     */
86
    public static function savePublicKey(Ed25519 $curve, array $publicKey)
93
    public static function savePublicKey(Ed25519 $curve, array $publicKey)
Line 89... Line 96...
89
    }
96
    }
90
 
97
 
91
    /**
98
    /**
92
     * Convert a private key to the appropriate format.
99
     * Convert a private key to the appropriate format.
93
     *
100
     *
-
 
101
     * @access public
94
     * @param \phpseclib3\Math\BigInteger $privateKey
102
     * @param \phpseclib3\Math\BigInteger $privateKey
95
     * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
103
     * @param \phpseclib3\Crypt\EC\Curves\Ed25519 $curve
96
     * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
104
     * @param \phpseclib3\Math\Common\FiniteField\Integer[] $publicKey
97
     * @param string $password optional
105
     * @param string $password optional
98
     * @return string
106
     * @return string