| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace SpomkyLabs\Pki\X501\ASN1\AttributeValue; |
| 6 |
|
| 7 |
use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType; |
| 8 |
use SpomkyLabs\Pki\X501\ASN1\AttributeType; |
| 9 |
use SpomkyLabs\Pki\X501\ASN1\AttributeValue\Feature\PrintableStringValue; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
final class CountryNameValue extends PrintableStringValue |
| 17 |
{ |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
protected function __construct(string $value) |
| 22 |
{ |
| 23 |
parent::__construct(AttributeType::OID_COUNTRY_NAME, $value); |
| 24 |
} |
| 25 |
|
| 26 |
public static function create(string $value): self |
| 27 |
{ |
| 28 |
return new self($value); |
| 29 |
} |
| 30 |
|
| 31 |
public static function fromASN1(UnspecifiedType $el): self |
| 32 |
{ |
| 33 |
return self::create($el->asPrintableString()->string()); |
| 34 |
} |
| 35 |
} |