Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | abstract class PublicKey |
||
14 | { |
||
15 | /** |
||
16 | * Get the public key algorithm identifier. |
||
17 | * |
||
18 | * @return AlgorithmIdentifierType |
||
19 | */ |
||
20 | abstract public function algorithmIdentifier(): AlgorithmIdentifierType; |
||
21 | |||
22 | /** |
||
23 | * Get DER encoding of the public key. |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | abstract public function toDER(): string; |
||
28 | |||
29 | /** |
||
30 | * Get the public key data for subjectPublicKey in PublicKeyInfo. |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | 3 | public function subjectPublicKeyData(): string |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * Get the public key as a PublicKeyInfo type. |
||
41 | * |
||
42 | * @return PublicKeyInfo |
||
43 | */ |
||
44 | 7 | public function publicKeyInfo(): PublicKeyInfo |
|
45 | { |
||
46 | 7 | return PublicKeyInfo::fromPublicKey($this); |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * Initialize public key from PEM. |
||
51 | * |
||
52 | * @param PEM $pem |
||
53 | * |
||
54 | * @throws \UnexpectedValueException |
||
55 | * |
||
56 | * @return PublicKey |
||
57 | */ |
||
58 | 6 | public static function fromPEM(PEM $pem) |
|
68 | } |
||
69 | } |
||
70 |