summaryrefslogtreecommitdiff
path: root/src/saml2/ws/wssec.py
blob: 7a1c47289835a81c5328b341204c4b68e9690794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
#!/usr/bin/env python

#
# Generated Sun Jun 14 13:29:15 2015 by parse_xsd.py version 0.5.
#

import saml2
from saml2 import SamlBase

from saml2 import xmldsig as ds
from saml2.schema import soapenv
from saml2.ws import wsutil as wsu

NAMESPACE = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'

class AttributedString_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:AttributedString element """

    c_tag = 'AttributedString'
    c_namespace = NAMESPACE
    c_value_type = {'base': 'string'}
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'string', False)

    def __init__(self,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self, 
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.Id=Id

def attributed_string__from_string(xml_string):
    return saml2.create_class_from_xml_string(AttributedString_, xml_string)

class PasswordString_(AttributedString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:PasswordString element """

    c_tag = 'PasswordString'
    c_namespace = NAMESPACE
    c_children = AttributedString_.c_children.copy()
    c_attributes = AttributedString_.c_attributes.copy()
    c_child_order = AttributedString_.c_child_order[:]
    c_cardinality = AttributedString_.c_cardinality.copy()
    c_attributes['Type'] = ('type', 'anyURI', False)

    def __init__(self,
            type=None,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        AttributedString_.__init__(self, 
                Id=Id,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.type=type

def password_string__from_string(xml_string):
    return saml2.create_class_from_xml_string(PasswordString_, xml_string)

class EncodedString_(AttributedString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EncodedString element """

    c_tag = 'EncodedString'
    c_namespace = NAMESPACE
    c_children = AttributedString_.c_children.copy()
    c_attributes = AttributedString_.c_attributes.copy()
    c_child_order = AttributedString_.c_child_order[:]
    c_cardinality = AttributedString_.c_cardinality.copy()
    c_attributes['EncodingType'] = ('encoding_type', 'anyURI', False)

    def __init__(self,
            encoding_type=None,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        AttributedString_.__init__(self, 
                Id=Id,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.encoding_type=encoding_type

def encoded_string__from_string(xml_string):
    return saml2.create_class_from_xml_string(EncodedString_, xml_string)

class UsernameTokenType_Username(AttributedString_):

    c_tag = 'Username'
    c_namespace = NAMESPACE
    c_children = AttributedString_.c_children.copy()
    c_attributes = AttributedString_.c_attributes.copy()
    c_child_order = AttributedString_.c_child_order[:]
    c_cardinality = AttributedString_.c_cardinality.copy()

def username_token_type__username_from_string(xml_string):
    return saml2.create_class_from_xml_string(UsernameTokenType_Username, xml_string)

class UsernameTokenType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameTokenType element """

    c_tag = 'UsernameTokenType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_children['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Username'] = ('username', UsernameTokenType_Username)
    c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'None', False)
    c_child_order.extend(['username'])

    def __init__(self,
            username=None,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self, 
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.username=username
        self.Id=Id

def username_token_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(UsernameTokenType_, xml_string)

class BinarySecurityTokenType_(EncodedString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityTokenType element """

    c_tag = 'BinarySecurityTokenType'
    c_namespace = NAMESPACE
    c_children = EncodedString_.c_children.copy()
    c_attributes = EncodedString_.c_attributes.copy()
    c_child_order = EncodedString_.c_child_order[:]
    c_cardinality = EncodedString_.c_cardinality.copy()
    c_attributes['ValueType'] = ('value_type', 'anyURI', False)

    def __init__(self,
            value_type=None,
            encoding_type=None,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        EncodedString_.__init__(self, 
                encoding_type=encoding_type,
                Id=Id,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.value_type=value_type

def binary_security_token_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(BinarySecurityTokenType_, xml_string)

class KeyIdentifierType_(EncodedString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifierType element """

    c_tag = 'KeyIdentifierType'
    c_namespace = NAMESPACE
    c_children = EncodedString_.c_children.copy()
    c_attributes = EncodedString_.c_attributes.copy()
    c_child_order = EncodedString_.c_child_order[:]
    c_cardinality = EncodedString_.c_cardinality.copy()
    c_attributes['ValueType'] = ('value_type', 'anyURI', False)

    def __init__(self,
            value_type=None,
            encoding_type=None,
            Id=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        EncodedString_.__init__(self, 
                encoding_type=encoding_type,
                Id=Id,
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.value_type=value_type

def key_identifier_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(KeyIdentifierType_, xml_string)

class TUsage_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:tUsage element """

    c_tag = 'tUsage'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def t_usage__from_string(xml_string):
    return saml2.create_class_from_xml_string(TUsage_, xml_string)

class ReferenceType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:ReferenceType element """

    c_tag = 'ReferenceType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_attributes['URI'] = ('uri', 'anyURI', False)
    c_attributes['ValueType'] = ('value_type', 'anyURI', False)

    def __init__(self,
            uri=None,
            value_type=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self, 
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.uri=uri
        self.value_type=value_type

def reference_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(ReferenceType_, xml_string)

class EmbeddedType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:EmbeddedType element """

    c_tag = 'EmbeddedType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_attributes['ValueType'] = ('value_type', 'anyURI', False)

    def __init__(self,
            value_type=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self, 
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.value_type=value_type

def embedded_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(EmbeddedType_, xml_string)

class SecurityTokenReferenceType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReferenceType element """

    c_tag = 'SecurityTokenReferenceType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()
    c_attributes['{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Id'] = ('Id', 'None', False)
    c_attributes['Usage'] = ('Usage', 'None', False)

    def __init__(self,
            Id=None,
            Usage=None,
            text=None,
            extension_elements=None,
            extension_attributes=None,
        ):
        SamlBase.__init__(self, 
                text=text,
                extension_elements=extension_elements,
                extension_attributes=extension_attributes,
                )
        self.Id=Id
        self.Usage=Usage

def security_token_reference_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(SecurityTokenReferenceType_, xml_string)

class SecurityHeaderType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityHeaderType element """

    c_tag = 'SecurityHeaderType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def security_header_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(SecurityHeaderType_, xml_string)

class TransformationParametersType_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParametersType element """

    c_tag = 'TransformationParametersType'
    c_namespace = NAMESPACE
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def transformation_parameters_type__from_string(xml_string):
    return saml2.create_class_from_xml_string(TransformationParametersType_, xml_string)

class UsernameToken(UsernameTokenType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameToken element """

    c_tag = 'UsernameToken'
    c_namespace = NAMESPACE
    c_children = UsernameTokenType_.c_children.copy()
    c_attributes = UsernameTokenType_.c_attributes.copy()
    c_child_order = UsernameTokenType_.c_child_order[:]
    c_cardinality = UsernameTokenType_.c_cardinality.copy()

def username_token_from_string(xml_string):
    return saml2.create_class_from_xml_string(UsernameToken, xml_string)

class BinarySecurityToken(BinarySecurityTokenType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:BinarySecurityToken element """

    c_tag = 'BinarySecurityToken'
    c_namespace = NAMESPACE
    c_children = BinarySecurityTokenType_.c_children.copy()
    c_attributes = BinarySecurityTokenType_.c_attributes.copy()
    c_child_order = BinarySecurityTokenType_.c_child_order[:]
    c_cardinality = BinarySecurityTokenType_.c_cardinality.copy()

def binary_security_token_from_string(xml_string):
    return saml2.create_class_from_xml_string(BinarySecurityToken, xml_string)


class Reference(ReferenceType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Reference element """

    c_tag = 'Reference'
    c_namespace = NAMESPACE
    c_children = ReferenceType_.c_children.copy()
    c_attributes = ReferenceType_.c_attributes.copy()
    c_child_order = ReferenceType_.c_child_order[:]
    c_cardinality = ReferenceType_.c_cardinality.copy()

def reference_from_string(xml_string):
    return saml2.create_class_from_xml_string(Reference, xml_string)


class Embedded(EmbeddedType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Embedded element """

    c_tag = 'Embedded'
    c_namespace = NAMESPACE
    c_children = EmbeddedType_.c_children.copy()
    c_attributes = EmbeddedType_.c_attributes.copy()
    c_child_order = EmbeddedType_.c_child_order[:]
    c_cardinality = EmbeddedType_.c_cardinality.copy()

def embedded_from_string(xml_string):
    return saml2.create_class_from_xml_string(Embedded, xml_string)


class KeyIdentifier(KeyIdentifierType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:KeyIdentifier element """

    c_tag = 'KeyIdentifier'
    c_namespace = NAMESPACE
    c_children = KeyIdentifierType_.c_children.copy()
    c_attributes = KeyIdentifierType_.c_attributes.copy()
    c_child_order = KeyIdentifierType_.c_child_order[:]
    c_cardinality = KeyIdentifierType_.c_cardinality.copy()

def key_identifier_from_string(xml_string):
    return saml2.create_class_from_xml_string(KeyIdentifier, xml_string)


class SecurityTokenReference(SecurityTokenReferenceType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:SecurityTokenReference element """

    c_tag = 'SecurityTokenReference'
    c_namespace = NAMESPACE
    c_children = SecurityTokenReferenceType_.c_children.copy()
    c_attributes = SecurityTokenReferenceType_.c_attributes.copy()
    c_child_order = SecurityTokenReferenceType_.c_child_order[:]
    c_cardinality = SecurityTokenReferenceType_.c_cardinality.copy()

def security_token_reference_from_string(xml_string):
    return saml2.create_class_from_xml_string(SecurityTokenReference, xml_string)


class Security(SecurityHeaderType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Security element """

    c_tag = 'Security'
    c_namespace = NAMESPACE
    c_children = SecurityHeaderType_.c_children.copy()
    c_attributes = SecurityHeaderType_.c_attributes.copy()
    c_child_order = SecurityHeaderType_.c_child_order[:]
    c_cardinality = SecurityHeaderType_.c_cardinality.copy()

def security_from_string(xml_string):
    return saml2.create_class_from_xml_string(Security, xml_string)


class TransformationParameters(TransformationParametersType_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:TransformationParameters element """

    c_tag = 'TransformationParameters'
    c_namespace = NAMESPACE
    c_children = TransformationParametersType_.c_children.copy()
    c_attributes = TransformationParametersType_.c_attributes.copy()
    c_child_order = TransformationParametersType_.c_child_order[:]
    c_cardinality = TransformationParametersType_.c_cardinality.copy()

def transformation_parameters_from_string(xml_string):
    return saml2.create_class_from_xml_string(TransformationParameters, xml_string)


class Password(PasswordString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Password element """

    c_tag = 'Password'
    c_namespace = NAMESPACE
    c_children = PasswordString_.c_children.copy()
    c_attributes = PasswordString_.c_attributes.copy()
    c_child_order = PasswordString_.c_child_order[:]
    c_cardinality = PasswordString_.c_cardinality.copy()

def password_from_string(xml_string):
    return saml2.create_class_from_xml_string(Password, xml_string)


class Nonce(EncodedString_):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Nonce element """

    c_tag = 'Nonce'
    c_namespace = NAMESPACE
    c_children = EncodedString_.c_children.copy()
    c_attributes = EncodedString_.c_attributes.copy()
    c_child_order = EncodedString_.c_child_order[:]
    c_cardinality = EncodedString_.c_cardinality.copy()

def nonce_from_string(xml_string):
    return saml2.create_class_from_xml_string(Nonce, xml_string)


class FaultcodeEnum_(SamlBase):
    """The http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:FaultcodeEnum element """

    c_tag = 'FaultcodeEnum'
    c_namespace = NAMESPACE
    c_value_type = {'base': 'xsd:QName', 'enumeration': ['wsse:UnsupportedSecurityToken', 'wsse:UnsupportedAlgorithm', 'wsse:InvalidSecurity', 'wsse:InvalidSecurityToken', 'wsse:FailedAuthentication', 'wsse:FailedCheck', 'wsse:SecurityTokenUnavailable']}
    c_children = SamlBase.c_children.copy()
    c_attributes = SamlBase.c_attributes.copy()
    c_child_order = SamlBase.c_child_order[:]
    c_cardinality = SamlBase.c_cardinality.copy()

def faultcode_enum__from_string(xml_string):
    return saml2.create_class_from_xml_string(FaultcodeEnum_, xml_string)


#..................
('#', [])
ELEMENT_FROM_STRING = {
    AttributedString_.c_tag: attributed_string__from_string,
    PasswordString_.c_tag: password_string__from_string,
    EncodedString_.c_tag: encoded_string__from_string,
    UsernameTokenType_.c_tag: username_token_type__from_string,
    BinarySecurityTokenType_.c_tag: binary_security_token_type__from_string,
    KeyIdentifierType_.c_tag: key_identifier_type__from_string,
    TUsage_.c_tag: t_usage__from_string,
    ReferenceType_.c_tag: reference_type__from_string,
    EmbeddedType_.c_tag: embedded_type__from_string,
    SecurityTokenReferenceType_.c_tag: security_token_reference_type__from_string,
    SecurityHeaderType_.c_tag: security_header_type__from_string,
    TransformationParametersType_.c_tag: transformation_parameters_type__from_string,
    UsernameToken.c_tag: username_token_from_string,
    BinarySecurityToken.c_tag: binary_security_token_from_string,
    Reference.c_tag: reference_from_string,
    Embedded.c_tag: embedded_from_string,
    KeyIdentifier.c_tag: key_identifier_from_string,
    SecurityTokenReference.c_tag: security_token_reference_from_string,
    Security.c_tag: security_from_string,
    TransformationParameters.c_tag: transformation_parameters_from_string,
    Password.c_tag: password_from_string,
    Nonce.c_tag: nonce_from_string,
    FaultcodeEnum_.c_tag: faultcode_enum__from_string,
    UsernameTokenType_Username.c_tag: username_token_type__username_from_string,
}

ELEMENT_BY_TAG = {
    'AttributedString': AttributedString_,
    'PasswordString': PasswordString_,
    'EncodedString': EncodedString_,
    'UsernameTokenType': UsernameTokenType_,
    'BinarySecurityTokenType': BinarySecurityTokenType_,
    'KeyIdentifierType': KeyIdentifierType_,
    'tUsage': TUsage_,
    'ReferenceType': ReferenceType_,
    'EmbeddedType': EmbeddedType_,
    'SecurityTokenReferenceType': SecurityTokenReferenceType_,
    'SecurityHeaderType': SecurityHeaderType_,
    'TransformationParametersType': TransformationParametersType_,
    'UsernameToken': UsernameToken,
    'BinarySecurityToken': BinarySecurityToken,
    'Reference': Reference,
    'Embedded': Embedded,
    'KeyIdentifier': KeyIdentifier,
    'SecurityTokenReference': SecurityTokenReference,
    'Security': Security,
    'TransformationParameters': TransformationParameters,
    'Password': Password,
    'Nonce': Nonce,
    'FaultcodeEnum': FaultcodeEnum_,
    'Username': UsernameTokenType_Username,
}


def factory(tag, **kwargs):
    return ELEMENT_BY_TAG[tag](**kwargs)