[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/Traits/ -> PasswordProtected.php (source)

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


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer