Subversion Repositories oidplus

Rev

Rev 846 | Rev 1042 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /**
  4.  * DH Parameters
  5.  *
  6.  * @category  Crypt
  7.  * @package   DH
  8.  * @author    Jim Wigginton <terrafrost@php.net>
  9.  * @copyright 2015 Jim Wigginton
  10.  * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
  11.  * @link      http://phpseclib.sourceforge.net
  12.  */
  13.  
  14. namespace phpseclib3\Crypt\DH;
  15.  
  16. use phpseclib3\Crypt\DH;
  17.  
  18. /**
  19.  * DH Parameters
  20.  *
  21.  * @package DH
  22.  * @author  Jim Wigginton <terrafrost@php.net>
  23.  * @access  public
  24.  */
  25. class Parameters extends DH
  26. {
  27.     /**
  28.      * Returns the parameters
  29.      *
  30.      * @param string $type
  31.      * @param array $options optional
  32.      * @return string
  33.      */
  34.     public function toString($type = 'PKCS1', array $options = [])
  35.     {
  36.         $type = self::validatePlugin('Keys', 'PKCS1', 'saveParameters');
  37.  
  38.         return $type::saveParameters($this->prime, $this->base, $options);
  39.     }
  40. }
  41.