[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * Raw Signature Handler 5 * 6 * PHP version 5 7 * 8 * Handles signatures as arrays 9 * 10 * @category Crypt 11 * @package Common 12 * @author Jim Wigginton <[email protected]> 13 * @copyright 2016 Jim Wigginton 14 * @license http://www.opensource.org/licenses/mit-license.html MIT License 15 * @link http://phpseclib.sourceforge.net 16 */ 17 18 namespace phpseclib3\Crypt\Common\Formats\Signature; 19 20 use phpseclib3\Math\BigInteger; 21 22 /** 23 * Raw Signature Handler 24 * 25 * @package Common 26 * @author Jim Wigginton <[email protected]> 27 * @access public 28 */ 29 abstract class Raw 30 { 31 /** 32 * Loads a signature 33 * 34 * @access public 35 * @param array $sig 36 * @return array|bool 37 */ 38 public static function load($sig) 39 { 40 switch (true) { 41 case !is_array($sig): 42 case !isset($sig['r']) || !isset($sig['s']): 43 case !$sig['r'] instanceof BigInteger: 44 case !$sig['s'] instanceof BigInteger: 45 return false; 46 } 47 48 return [ 49 'r' => $sig['r'], 50 's' => $sig['s'] 51 ]; 52 } 53 54 /** 55 * Returns a signature in the appropriate format 56 * 57 * @access public 58 * @param \phpseclib3\Math\BigInteger $r 59 * @param \phpseclib3\Math\BigInteger $s 60 * @return string 61 */ 62 public static function save(BigInteger $r, BigInteger $s) 63 { 64 return compact('r', 's'); 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |