| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace SpomkyLabs\Pki\X509\Certificate\Extension\CertificatePolicy; |
| 6 |
|
| 7 |
use SpomkyLabs\Pki\ASN1\Element; |
| 8 |
use SpomkyLabs\Pki\ASN1\Type\Primitive\IA5String; |
| 9 |
use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
final class CPSQualifier extends PolicyQualifierInfo |
| 17 |
{ |
| 18 |
private function __construct( |
| 19 |
private readonly string $uri |
| 20 |
) { |
| 21 |
parent::__construct(self::OID_CPS); |
| 22 |
} |
| 23 |
|
| 24 |
public static function create(string $uri): self |
| 25 |
{ |
| 26 |
return new self($uri); |
| 27 |
} |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
public static function fromQualifierASN1(UnspecifiedType $el): PolicyQualifierInfo |
| 33 |
{ |
| 34 |
return self::create($el->asString()->string()); |
| 35 |
} |
| 36 |
|
| 37 |
public function uri(): string |
| 38 |
{ |
| 39 |
return $this->uri; |
| 40 |
} |
| 41 |
|
| 42 |
protected function qualifierASN1(): Element |
| 43 |
{ |
| 44 |
return IA5String::create($this->uri); |
| 45 |
} |
| 46 |
} |