Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| KeyChain | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| getIdentifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPublicKey | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPrivateKey | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2020 (original work) Open Assessment Technologies SA; |
| 19 | */ |
| 20 | |
| 21 | declare(strict_types=1); |
| 22 | |
| 23 | namespace oat\tao\model\security\Business\Domain\Key; |
| 24 | |
| 25 | final class KeyChain |
| 26 | { |
| 27 | /** @var string */ |
| 28 | private $identifier; |
| 29 | |
| 30 | /** @var string */ |
| 31 | private $name; |
| 32 | |
| 33 | /** @var Key */ |
| 34 | private $publicKey; |
| 35 | |
| 36 | /** @var Key */ |
| 37 | private $privateKey; |
| 38 | |
| 39 | public function __construct(string $identifier, string $name, Key $publicKey, Key $privateKey) |
| 40 | { |
| 41 | $this->identifier = $identifier; |
| 42 | $this->name = $name; |
| 43 | $this->publicKey = $publicKey; |
| 44 | $this->privateKey = $privateKey; |
| 45 | } |
| 46 | |
| 47 | public function getIdentifier(): string |
| 48 | { |
| 49 | return $this->identifier; |
| 50 | } |
| 51 | |
| 52 | public function getName(): string |
| 53 | { |
| 54 | return $this->name; |
| 55 | } |
| 56 | |
| 57 | public function getPublicKey(): Key |
| 58 | { |
| 59 | return $this->publicKey; |
| 60 | } |
| 61 | |
| 62 | public function getPrivateKey(): Key |
| 63 | { |
| 64 | return $this->privateKey; |
| 65 | } |
| 66 | } |