1 | <?php |
||
16 | class AttCertValidityPeriod |
||
17 | { |
||
18 | use DateTimeHelper; |
||
19 | |||
20 | /** |
||
21 | * Not before time. |
||
22 | * |
||
23 | * @var \DateTimeImmutable |
||
24 | */ |
||
25 | protected $_notBeforeTime; |
||
26 | |||
27 | /** |
||
28 | * Not after time. |
||
29 | * |
||
30 | * @var \DateTimeImmutable |
||
31 | */ |
||
32 | protected $_notAfterTime; |
||
33 | |||
34 | /** |
||
35 | * Constructor. |
||
36 | * |
||
37 | * @param \DateTimeImmutable $nb |
||
38 | * @param \DateTimeImmutable $na |
||
39 | */ |
||
40 | 9 | public function __construct(\DateTimeImmutable $nb, \DateTimeImmutable $na) |
|
45 | |||
46 | /** |
||
47 | * Initialize from ASN.1. |
||
48 | * |
||
49 | * @param Sequence $seq |
||
50 | * @return self |
||
51 | */ |
||
52 | 6 | public static function fromASN1(Sequence $seq): self |
|
62 | |||
63 | /** |
||
64 | * Initialize from date strings. |
||
65 | * |
||
66 | * @param string|null $nb_date Not before date |
||
67 | * @param string|null $na_date Not after date |
||
68 | * @param string|null $tz Timezone string |
||
69 | * @return self |
||
70 | */ |
||
71 | 2 | public static function fromStrings($nb_date, $na_date, $tz = null): self |
|
77 | |||
78 | /** |
||
79 | * Get not before time. |
||
80 | * |
||
81 | * @return \DateTimeImmutable |
||
82 | */ |
||
83 | 7 | public function notBeforeTime(): \DateTimeImmutable |
|
87 | |||
88 | /** |
||
89 | * Get not after time. |
||
90 | * |
||
91 | * @return \DateTimeImmutable |
||
92 | */ |
||
93 | 6 | public function notAfterTime(): \DateTimeImmutable |
|
97 | |||
98 | /** |
||
99 | * Generate ASN.1 structure. |
||
100 | * |
||
101 | * @return Sequence |
||
102 | */ |
||
103 | 20 | public function toASN1(): Sequence |
|
108 | } |
||
109 |