| Total Complexity | 7 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class ExchangeInformation extends BasicDataStructure |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * The prime number property storage. |
||
| 25 | * |
||
| 26 | * @var string The chosen prime number, also knows as `p` |
||
| 27 | */ |
||
| 28 | protected $prime = ''; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The generator number property storage. |
||
| 32 | * |
||
| 33 | * @var string The chosen generator number, also knows as `g` |
||
| 34 | */ |
||
| 35 | protected $generator = ''; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * The private key property storage. |
||
| 39 | * |
||
| 40 | * @var string The private key. |
||
| 41 | */ |
||
| 42 | protected $private = ''; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * The public key property storage. |
||
| 46 | * |
||
| 47 | * @var string The public key. |
||
| 48 | */ |
||
| 49 | protected $public = ''; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Exchange information constructor. |
||
| 53 | * |
||
| 54 | * @param string $prime The hexadecimal representation of a prime number, also knows as `p`. |
||
| 55 | * @param string $generator The hexadecimal generator number, a primitive root modulo of `p`, also known as `g`. |
||
| 56 | * @param string $privateKey The private key. |
||
| 57 | * @param string $publicKey The public key. |
||
| 58 | */ |
||
| 59 | public function __construct($prime = '', $generator = '', $privateKey = '', $publicKey = '') |
||
| 60 | { |
||
| 61 | if (is_string($prime)) { |
||
|
1 ignored issue
–
show
|
|||
| 62 | $this->prime = $prime; |
||
| 63 | } |
||
| 64 | |||
| 65 | if (is_string($generator)) { |
||
|
1 ignored issue
–
show
|
|||
| 66 | $this->generator = $generator; |
||
| 67 | } |
||
| 68 | |||
| 69 | if (is_string($privateKey)) { |
||
|
1 ignored issue
–
show
|
|||
| 70 | $this->private = $privateKey; |
||
| 71 | } |
||
| 72 | |||
| 73 | if (is_string($publicKey)) { |
||
|
1 ignored issue
–
show
|
|||
| 74 | $this->public = $publicKey; |
||
| 75 | } |
||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Exchange information destructor |
||
| 80 | */ |
||
| 81 | public function __destruct() |
||
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * The key exchange information data string representation. |
||
| 87 | * |
||
| 88 | * @return string |
||
| 89 | */ |
||
| 90 | public function __toString() |
||
| 98 |