1 | <?php |
||
26 | class Attributes implements \Countable, \IteratorAggregate |
||
27 | { |
||
28 | use AttributeContainer; |
||
29 | |||
30 | /** |
||
31 | * Mapping from OID to attribute value class name. |
||
32 | * |
||
33 | * @internal |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | const MAP_OID_TO_CLASS = array( |
||
38 | /* @formatter:off */ |
||
39 | AccessIdentityAttributeValue::OID => AccessIdentityAttributeValue::class, |
||
40 | AuthenticationInfoAttributeValue::OID => AuthenticationInfoAttributeValue::class, |
||
41 | ChargingIdentityAttributeValue::OID => ChargingIdentityAttributeValue::class, |
||
42 | GroupAttributeValue::OID => GroupAttributeValue::class, |
||
43 | AttributeType::OID_ROLE => RoleAttributeValue::class |
||
44 | /* @formatter:on */ |
||
45 | ); |
||
46 | |||
47 | /** |
||
48 | * Constructor |
||
49 | * |
||
50 | * @param Attribute ...$attribs |
||
51 | */ |
||
52 | 14 | public function __construct(Attribute ...$attribs) { |
|
55 | |||
56 | /** |
||
57 | * Initialize from attribute values. |
||
58 | * |
||
59 | * @param AttributeValue ...$values |
||
60 | * @return self |
||
61 | */ |
||
62 | 8 | public static function fromAttributeValues(AttributeValue ...$values) { |
|
69 | |||
70 | /** |
||
71 | * Initialize from ASN.1. |
||
72 | * |
||
73 | * @param Sequence $seq |
||
74 | * @return self |
||
75 | */ |
||
76 | 6 | public static function fromASN1(Sequence $seq) { |
|
93 | |||
94 | /** |
||
95 | * Check whether 'Access Identity' attribute is present. |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | 1 | public function hasAccessIdentity() { |
|
102 | |||
103 | /** |
||
104 | * Get the first 'Access Identity' attribute value. |
||
105 | * |
||
106 | * @return AccessIdentityAttributeValue |
||
107 | */ |
||
108 | 1 | public function accessIdentity() { |
|
111 | |||
112 | /** |
||
113 | * Check whether 'Service Authentication Information' attribute is present. |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | 1 | public function hasAuthenticationInformation() { |
|
120 | |||
121 | /** |
||
122 | * Get the first 'Service Authentication Information' attribute value. |
||
123 | * |
||
124 | * @return AuthenticationInfoAttributeValue |
||
125 | */ |
||
126 | 1 | public function authenticationInformation() { |
|
129 | |||
130 | /** |
||
131 | * Check whether 'Charging Identity' attribute is present. |
||
132 | * |
||
133 | * @return bool |
||
134 | */ |
||
135 | 1 | public function hasChargingIdentity() { |
|
138 | |||
139 | /** |
||
140 | * Get the first 'Charging Identity' attribute value. |
||
141 | * |
||
142 | * @return ChargingIdentityAttributeValue |
||
143 | */ |
||
144 | 1 | public function chargingIdentity() { |
|
147 | |||
148 | /** |
||
149 | * Check whether 'Group' attribute is present. |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | 1 | public function hasGroup() { |
|
156 | |||
157 | /** |
||
158 | * Get the first 'Group' attribute value. |
||
159 | * |
||
160 | * @return GroupAttributeValue |
||
161 | */ |
||
162 | 1 | public function group() { |
|
165 | |||
166 | /** |
||
167 | * Check whether 'Role' attribute is present. |
||
168 | * |
||
169 | * @return bool |
||
170 | */ |
||
171 | 1 | public function hasRole() { |
|
174 | |||
175 | /** |
||
176 | * Get the first 'Role' attribute value. |
||
177 | * |
||
178 | * @return RoleAttributeValue |
||
179 | */ |
||
180 | 1 | public function role() { |
|
183 | |||
184 | /** |
||
185 | * Get all 'Role' attribute values. |
||
186 | * |
||
187 | * @return RoleAttributeValue[] |
||
188 | */ |
||
189 | 2 | public function roles() { |
|
196 | |||
197 | /** |
||
198 | * Generate ASN.1 structure. |
||
199 | * |
||
200 | * @return Sequence |
||
201 | */ |
||
202 | 20 | public function toASN1() { |
|
209 | } |
||
210 |