1 | <?php |
||
8 | class Certificate |
||
9 | { |
||
10 | protected $rawCert; |
||
11 | protected $certData; |
||
12 | |||
13 | /** |
||
14 | * @var SanParser |
||
15 | */ |
||
16 | protected $sanParser; |
||
17 | |||
18 | /** |
||
19 | * Certificate constructor. |
||
20 | * |
||
21 | * @param string $certificate |
||
22 | * @param SanParser $sanParser |
||
23 | */ |
||
24 | 8 | public function __construct($certificate, SanParser $sanParser = null) |
|
36 | |||
37 | /** |
||
38 | * @return DateTime |
||
39 | */ |
||
40 | 3 | public function validFrom() |
|
46 | |||
47 | /** |
||
48 | * @return DateTime |
||
49 | */ |
||
50 | 3 | public function validTo() |
|
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | 3 | public function certName() |
|
64 | |||
65 | /** |
||
66 | * @return array |
||
67 | */ |
||
68 | 3 | public function subject() |
|
72 | |||
73 | /** |
||
74 | * @return array |
||
75 | */ |
||
76 | 3 | public function issuer() |
|
80 | |||
81 | /** |
||
82 | * @return array |
||
83 | */ |
||
84 | public function sans() |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | 6 | public function toString() |
|
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | 6 | public function __toString() |
|
104 | |||
105 | 8 | protected function extractCertData($certificate) |
|
115 | } |
||
116 |