1 | <?php |
||
21 | class Attributes implements \Countable, \IteratorAggregate |
||
22 | { |
||
23 | use AttributeContainer; |
||
24 | |||
25 | /** |
||
26 | * Mapping from OID to attribute value class name. |
||
27 | * |
||
28 | * @internal |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | const MAP_OID_TO_CLASS = array( |
||
33 | /* @formatter:off */ |
||
34 | ExtensionRequestValue::OID => ExtensionRequestValue::class |
||
35 | /* @formatter:on */ |
||
36 | ); |
||
37 | |||
38 | /** |
||
39 | * Constructor. |
||
40 | * |
||
41 | * @param Attribute ...$attribs Attribute objects |
||
42 | */ |
||
43 | 8 | public function __construct(Attribute ...$attribs) |
|
47 | |||
48 | /** |
||
49 | * Initialize from attribute values. |
||
50 | * |
||
51 | * @param AttributeValue ...$values |
||
52 | * @return self |
||
53 | */ |
||
54 | 1 | public static function fromAttributeValues(AttributeValue ...$values): Attributes |
|
62 | |||
63 | /** |
||
64 | * Initialize from ASN.1. |
||
65 | * |
||
66 | * @param Set $set |
||
67 | * @return self |
||
68 | */ |
||
69 | 4 | public static function fromASN1(Set $set): Attributes |
|
87 | |||
88 | /** |
||
89 | * Check whether extension request attribute is present. |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | 6 | public function hasExtensionRequest(): bool |
|
97 | |||
98 | /** |
||
99 | * Get extension request attribute value. |
||
100 | * |
||
101 | * @throws \LogicException |
||
102 | * @return ExtensionRequestValue |
||
103 | */ |
||
104 | 4 | public function extensionRequest(): ExtensionRequestValue |
|
111 | |||
112 | /** |
||
113 | * Generate ASN.1 structure. |
||
114 | * |
||
115 | * @return Set |
||
116 | */ |
||
117 | 5 | public function toASN1(): Set |
|
126 | } |
||
127 |