1 | <?php |
||
21 | class AuthorityKeyIdentifierExtension extends Extension |
||
22 | { |
||
23 | /** |
||
24 | * Key identifier. |
||
25 | * |
||
26 | * @var string|null $_keyIdentifier |
||
27 | */ |
||
28 | protected $_keyIdentifier; |
||
29 | |||
30 | /** |
||
31 | * Issuer name. |
||
32 | * |
||
33 | * @var GeneralNames|null $_authorityCertIssuer |
||
34 | */ |
||
35 | protected $_authorityCertIssuer; |
||
36 | |||
37 | /** |
||
38 | * Issuer serial number. |
||
39 | * |
||
40 | * @var string|null $_authorityCertSerialNumber |
||
41 | */ |
||
42 | protected $_authorityCertSerialNumber; |
||
43 | |||
44 | /** |
||
45 | * Constructor. |
||
46 | * |
||
47 | * @param bool $critical Conforming CA's must mark as non-critical (false) |
||
48 | * @param string|null $keyIdentifier |
||
49 | * @param GeneralNames|null $issuer |
||
50 | * @param string|null $serial |
||
51 | */ |
||
52 | 27 | public function __construct(bool $critical, $keyIdentifier, |
|
60 | |||
61 | /** |
||
62 | * Create from public key info. |
||
63 | * |
||
64 | * @param PublicKeyInfo $pki |
||
65 | * @return AuthorityKeyIdentifierExtension |
||
66 | */ |
||
67 | 1 | public static function fromPublicKeyInfo(PublicKeyInfo $pki) |
|
71 | |||
72 | /** |
||
73 | * |
||
74 | * {@inheritdoc} |
||
75 | * @return self |
||
76 | */ |
||
77 | 20 | protected static function _fromDER(string $data, bool $critical): self |
|
107 | |||
108 | /** |
||
109 | * Whether key identifier is present. |
||
110 | * |
||
111 | * @return bool |
||
112 | */ |
||
113 | 12 | public function hasKeyIdentifier(): bool |
|
117 | |||
118 | /** |
||
119 | * Get key identifier. |
||
120 | * |
||
121 | * @throws \LogicException |
||
122 | * @return string |
||
123 | */ |
||
124 | 12 | public function keyIdentifier(): string |
|
131 | |||
132 | /** |
||
133 | * Whether issuer is present. |
||
134 | * |
||
135 | * @return bool |
||
136 | */ |
||
137 | 5 | public function hasIssuer(): bool |
|
141 | |||
142 | /** |
||
143 | * Get issuer. |
||
144 | * |
||
145 | * @throws \LogicException |
||
146 | * @return GeneralNames |
||
147 | */ |
||
148 | 3 | public function issuer(): GeneralNames |
|
155 | |||
156 | /** |
||
157 | * Get serial number. |
||
158 | * |
||
159 | * @throws \LogicException |
||
160 | * @return string Base 10 integer string |
||
161 | */ |
||
162 | 3 | public function serial(): string |
|
170 | |||
171 | /** |
||
172 | * |
||
173 | * {@inheritdoc} |
||
174 | * @return Sequence |
||
175 | */ |
||
176 | 49 | protected function _valueASN1(): Sequence |
|
200 | } |
||
201 |