| Total Complexity | 4 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 5 | final class Keypair |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Secret key |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private $secretKey; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Public Key |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | private $publicKey; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Constructor |
||
| 23 | * |
||
| 24 | * @param string $secret |
||
| 25 | * @param string $public |
||
| 26 | */ |
||
| 27 | public function __construct(string $secretKey, string $publicKey) |
||
| 28 | { |
||
| 29 | $this->secretKey = $secretKey; |
||
| 30 | $this->publicKey = $publicKey; |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Returns the public key |
||
| 35 | * |
||
| 36 | * @return string|null |
||
| 37 | */ |
||
| 38 | public function getPublicKey() :? string |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Returns the secret key |
||
| 45 | * |
||
| 46 | * @return string|null |
||
| 47 | */ |
||
| 48 | public function getSecretKey() :? string |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Returns the sodium keypair |
||
| 55 | * |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | public function getSodiumKeypair() |
||
| 66 |