| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | abstract class AsymmetricKey implements KeyInterface |
||
| 18 | { |
||
| 19 | /** @var \SimpleSAML\XMLSecurity\CryptoEncoding\PEM */ |
||
| 20 | protected PEM $material; |
||
| 21 | |||
| 22 | |||
| 23 | /** |
||
| 24 | * Build a new key with $key as its material. |
||
| 25 | * |
||
| 26 | * @param \SimpleSAML\XMLSecurity\CryptoEncoding\PEM $key The associated key material. |
||
| 27 | */ |
||
| 28 | public function __construct(PEM $key) |
||
| 29 | { |
||
| 30 | $this->material = $key; |
||
| 31 | } |
||
| 32 | |||
| 33 | |||
| 34 | /** |
||
| 35 | * Return the key material associated with this key. |
||
| 36 | * |
||
| 37 | * @return string The key material. |
||
| 38 | */ |
||
| 39 | public function getMaterial(): string |
||
| 40 | { |
||
| 41 | return $this->material->string(); |
||
| 42 | } |
||
| 43 | |||
| 44 | |||
| 45 | /** |
||
| 46 | * Return the raw PEM-object associated with this key. |
||
| 47 | * |
||
| 48 | * @return \SimpleSAML\XMLSecurity\CryptoEncoding\PEM The raw material. |
||
| 49 | */ |
||
| 50 | public function getPEM(): PEM |
||
| 53 | } |
||
| 54 | } |
||
| 55 |