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 3... Line 3...
3
/**
3
/**
4
 * Password Protected Trait for Private Keys
4
 * Password Protected Trait for Private Keys
5
 *
5
 *
6
 * PHP version 5
6
 * PHP version 5
7
 *
7
 *
-
 
8
 * @category  Crypt
-
 
9
 * @package   Common
8
 * @author    Jim Wigginton <terrafrost@php.net>
10
 * @author    Jim Wigginton <terrafrost@php.net>
9
 * @copyright 2015 Jim Wigginton
11
 * @copyright 2015 Jim Wigginton
10
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
12
 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
11
 * @link      http://phpseclib.sourceforge.net
13
 * @link      http://phpseclib.sourceforge.net
12
 */
14
 */
Line 14... Line 16...
14
namespace phpseclib3\Crypt\Common\Traits;
16
namespace phpseclib3\Crypt\Common\Traits;
15
 
17
 
16
/**
18
/**
17
 * Password Protected Trait for Private Keys
19
 * Password Protected Trait for Private Keys
18
 *
20
 *
-
 
21
 * @package Common
19
 * @author  Jim Wigginton <terrafrost@php.net>
22
 * @author  Jim Wigginton <terrafrost@php.net>
-
 
23
 * @access  public
20
 */
24
 */
21
trait PasswordProtected
25
trait PasswordProtected
22
{
26
{
23
    /**
27
    /**
24
     * Password
28
     * Password
Line 33... Line 37...
33
     * Private keys can be encrypted with a password.  To unset the password, pass in the empty string or false.
37
     * Private keys can be encrypted with a password.  To unset the password, pass in the empty string or false.
34
     * Or rather, pass in $password such that empty($password) && !is_string($password) is true.
38
     * Or rather, pass in $password such that empty($password) && !is_string($password) is true.
35
     *
39
     *
36
     * @see self::createKey()
40
     * @see self::createKey()
37
     * @see self::load()
41
     * @see self::load()
-
 
42
     * @access public
38
     * @param string|bool $password
43
     * @param string|bool $password
39
     */
44
     */
40
    public function withPassword($password = false)
45
    public function withPassword($password = false)
41
    {
46
    {
42
        $new = clone $this;
47
        $new = clone $this;