<?php
 declare(strict_types=1); namespace SpomkyLabs\Pki\ASN1\Type; use DateTimeImmutable; use SpomkyLabs\Pki\ASN1\Element; use Stringable; abstract class BaseTime extends Element implements TimeType, Stringable { public const TZ_UTC = 'UTC'; protected function __construct( int $typeTag, protected readonly DateTimeImmutable $dateTime ) { parent::__construct($typeTag); } public function __toString(): string { return $this->string(); } abstract public static function fromString(string $time): static; public function dateTime(): DateTimeImmutable { return $this->dateTime; } public function string(): string { return $this->encodedAsDER(); } } 