| Total Complexity | 6 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class DirectoryName extends GeneralName |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * Directory name. |
||
| 21 | * |
||
| 22 | * @var Name |
||
| 23 | */ |
||
| 24 | protected $_dn; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Constructor. |
||
| 28 | * |
||
| 29 | * @param Name $dn |
||
| 30 | */ |
||
| 31 | 66 | public function __construct(Name $dn) |
|
| 35 | 66 | } |
|
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | * |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | 37 | public static function fromChosenASN1(UnspecifiedType $el): GeneralName |
|
| 43 | { |
||
| 44 | 37 | return new self(Name::fromASN1($el->asSequence())); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Initialize from distinguished name string. |
||
| 49 | * |
||
| 50 | * @param string $str |
||
| 51 | * |
||
| 52 | * @return self |
||
| 53 | */ |
||
| 54 | 20 | public static function fromDNString(string $str): self |
|
| 55 | { |
||
| 56 | 20 | return new self(Name::fromString($str)); |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * {@inheritdoc} |
||
| 61 | */ |
||
| 62 | 3 | public function string(): string |
|
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Get directory name. |
||
| 69 | * |
||
| 70 | * @return Name |
||
| 71 | */ |
||
| 72 | 42 | public function dn(): Name |
|
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * {@inheritdoc} |
||
| 79 | */ |
||
| 80 | 58 | protected function _choiceASN1(): TaggedType |
|
| 87 |