1 | <?php |
||
18 | */ |
||
19 | class ExtensionRequestValue extends AttributeValue |
||
20 | { |
||
21 | const OID = '1.2.840.113549.1.9.14'; |
||
22 | |||
23 | /** |
||
24 | * Extensions. |
||
25 | * |
||
26 | * @var Extensions |
||
27 | */ |
||
28 | protected $_extensions; |
||
29 | |||
30 | /** |
||
31 | * Constructor. |
||
32 | * |
||
33 | * @param Extensions $extensions |
||
34 | 11 | */ |
|
35 | public function __construct(Extensions $extensions) |
||
36 | 11 | { |
|
37 | 11 | $this->_extensions = $extensions; |
|
38 | 11 | $this->_oid = self::OID; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | * |
||
44 | * @return self |
||
45 | */ |
||
46 | 6 | public static function fromASN1(UnspecifiedType $el): AttributeValue |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * Get requested extensions. |
||
53 | * |
||
54 | * @return Extensions |
||
55 | */ |
||
56 | 4 | public function extensions(): Extensions |
|
57 | { |
||
58 | 4 | return $this->_extensions; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function toASN1(): Element |
||
65 | { |
||
66 | 10 | return $this->_extensions->toASN1(); |
|
67 | } |
||
68 | 10 | ||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function stringValue(): string |
||
73 | { |
||
74 | return '#' . bin2hex($this->toASN1()->toDER()); |
||
75 | } |
||
76 | 3 | ||
77 | /** |
||
78 | 3 | * {@inheritdoc} |
|
79 | */ |
||
80 | public function equalityMatchingRule(): MatchingRule |
||
81 | { |
||
82 | return new BinaryMatch(); |
||
83 | } |
||
84 | |||
85 | /** |
||
86 | 1 | * {@inheritdoc} |
|
87 | */ |
||
88 | 1 | public function rfc2253String(): string |
|
89 | { |
||
90 | return $this->stringValue(); |
||
91 | } |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | 1 | protected function _transcodedString(): string |
|
99 | } |
||
100 | } |
||
101 |