DLMS-SPODES 0.87.16__py3-none-any.whl → 0.88.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- DLMS_SPODES/Values/EN/__init__.py +1 -1
- DLMS_SPODES/Values/EN/actors.py +8 -8
- DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
- DLMS_SPODES/Values/RU/__init__.py +1 -1
- DLMS_SPODES/Values/RU/actors.py +8 -8
- DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
- DLMS_SPODES/__init__.py +6 -6
- DLMS_SPODES/configEN.ini +126 -126
- DLMS_SPODES/config_parser.py +53 -53
- DLMS_SPODES/cosem_interface_classes/Overview/__init__.py +0 -0
- DLMS_SPODES/cosem_interface_classes/Overview/class_id.py +107 -0
- DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +3 -2
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +210 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +78 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +50 -34
- DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
- DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +440 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +126 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +30 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +3 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +14 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +81 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2106 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +525 -583
- DLMS_SPODES/cosem_interface_classes/data.py +12 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +32 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +56 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +18 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +33 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +78 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +42 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +6 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +27 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +9 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +54 -126
- DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
- DLMS_SPODES/cosem_interface_classes/implementations/data.py +491 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +85 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +42 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +77 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +334 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +51 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +27 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +48 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +28 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +198 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +548 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +90 -122
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +268 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +13 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +9 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +124 -166
- DLMS_SPODES/cosem_interface_classes/register.py +18 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +45 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +33 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +72 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +88 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +54 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +45 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +122 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +34 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +54 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +20 -42
- DLMS_SPODES/cosem_pdu.py +93 -93
- DLMS_SPODES/enums.py +625 -625
- DLMS_SPODES/exceptions.py +106 -106
- DLMS_SPODES/firmwares.py +99 -99
- DLMS_SPODES/hdlc/frame.py +875 -875
- DLMS_SPODES/hdlc/sub_layer.py +54 -54
- DLMS_SPODES/literals.py +17 -17
- DLMS_SPODES/obis/__init__.py +1 -1
- DLMS_SPODES/obis/media_id.py +931 -931
- DLMS_SPODES/pardata.py +22 -22
- DLMS_SPODES/pdu_enums.py +98 -98
- DLMS_SPODES/relation_to_OBIS.py +463 -465
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +140 -142
- DLMS_SPODES/types/common_data_types.py +2379 -2401
- DLMS_SPODES/types/cosem_service_types.py +109 -109
- DLMS_SPODES/types/implementations/arrays.py +25 -25
- DLMS_SPODES/types/implementations/bitstrings.py +97 -97
- DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
- DLMS_SPODES/types/implementations/enums.py +57 -57
- DLMS_SPODES/types/implementations/integers.py +12 -11
- DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
- DLMS_SPODES/types/implementations/octet_string.py +11 -11
- DLMS_SPODES/types/implementations/structs.py +64 -64
- DLMS_SPODES/types/type_alias.py +74 -0
- DLMS_SPODES/types/useful_types.py +627 -677
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/METADATA +30 -30
- dlms_spodes-0.88.1.dist-info/RECORD +118 -0
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/WHEEL +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +0 -20
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +0 -12
- dlms_spodes-0.87.16.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.16.dist-info → dlms_spodes-0.88.1.dist-info}/top_level.txt +0 -0
|
@@ -1,105 +1,78 @@
|
|
|
1
|
-
from .
|
|
2
|
-
from ..types.implementations import
|
|
3
|
-
from
|
|
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
|
-
def
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
@property
|
|
81
|
-
def most_recent_request_table(self) -> MostRecentRequestTable:
|
|
82
|
-
return self.get_attr(5)
|
|
83
|
-
|
|
84
|
-
@property
|
|
85
|
-
def last_outcome(self) -> cdt.Unsigned:
|
|
86
|
-
return self.get_attr(6)
|
|
87
|
-
|
|
88
|
-
@property
|
|
89
|
-
def request_action(self) -> RequestAction:
|
|
90
|
-
return self .get_meth(1)
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def reset(self) -> integers.Only0:
|
|
94
|
-
return self .get_meth(2)
|
|
95
|
-
|
|
96
|
-
def __check_permission_table(self):
|
|
97
|
-
"""set length actor_permission be same as action array size if it not valid"""
|
|
98
|
-
if len(self.permissions_table) > 0:
|
|
99
|
-
for actor in self.permissions_table:
|
|
100
|
-
if len(actor) != len(self.actions):
|
|
101
|
-
actor.set(ActorPermissions('0'*len(self.actions)))
|
|
102
|
-
else:
|
|
103
|
-
"""lenght is correct, change is not required """
|
|
104
|
-
else:
|
|
105
|
-
"""not was loaded"""
|
|
1
|
+
from ..types.implementations import structs
|
|
2
|
+
from ..types.implementations import integers
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from ..types import cdt
|
|
5
|
+
from .cosem_interface_class import ICAElement, ICMElement, Classifier, ICAuto
|
|
6
|
+
from .Overview import class_id
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Actions(cdt.Array):
|
|
10
|
+
""" Array of key_data """
|
|
11
|
+
TYPE = structs.ActionItem
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActorPermissions(cdt.BitString):
|
|
15
|
+
"""TODO: """
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PermissionsTable(cdt.Array):
|
|
19
|
+
TYPE = ActorPermissions
|
|
20
|
+
__iter__: ActorPermissions
|
|
21
|
+
__get_item__: ActorPermissions
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ActorActionWeight(cdt.LongUnsigned):
|
|
25
|
+
"""TODO: make any thing"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ActorWeightingList(cdt.Array):
|
|
29
|
+
TYPE = ActorActionWeight
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class WeightingsTable(cdt.Array):
|
|
33
|
+
TYPE = ActorWeightingList
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class MostRecentRequest(cdt.BitString):
|
|
37
|
+
"""TODO: """
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class MostRecentRequestTable(cdt.Array):
|
|
41
|
+
TYPE = MostRecentRequest
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class RequestAction(cdt.Structure):
|
|
45
|
+
"""Defines the actions that are requested by an actorDefines the actions that are requested by an actor"""
|
|
46
|
+
request_actor: cdt.Unsigned
|
|
47
|
+
request_action_list: cdt.BitString
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Arbitrator(ICAuto):
|
|
51
|
+
"""4.5.12 Arbitrator"""
|
|
52
|
+
CLASS_ID = class_id.ARBITRATOR
|
|
53
|
+
VERSION = 0
|
|
54
|
+
A_ELEMENTS = (ICAElement(2, "actions", Actions),
|
|
55
|
+
ICAElement(3, "permission_table", PermissionsTable),
|
|
56
|
+
ICAElement(4, "weightings_table", WeightingsTable),
|
|
57
|
+
ICAElement(5, "most_recent_requests_table", MostRecentRequestTable, classifier=Classifier.DYNAMIC),
|
|
58
|
+
ICAElement(6, "last_outcome", cdt.Unsigned, min=0, default=0, classifier=Classifier.DYNAMIC)) # TODO: max = n what it?
|
|
59
|
+
M_ELEMENTS = (ICMElement(1, "request_action", RequestAction),
|
|
60
|
+
ICMElement(2, "reset", integers.INTEGER_0))
|
|
61
|
+
actors: tuple[str] = tuple()
|
|
62
|
+
"""name actors container"""
|
|
63
|
+
actions: Optional[Actions]
|
|
64
|
+
permissions_table: Optional[PermissionsTable]
|
|
65
|
+
weightings_table: Optional[WeightingsTable]
|
|
66
|
+
most_recent_request_table: Optional[MostRecentRequestTable]
|
|
67
|
+
last_outcome: Optional[cdt.Unsigned]
|
|
68
|
+
|
|
69
|
+
def __check_permission_table(self):
|
|
70
|
+
"""set length actor_permission be same as action array size if it not valid"""
|
|
71
|
+
if len(self.permissions_table) > 0:
|
|
72
|
+
for actor in self.permissions_table:
|
|
73
|
+
if len(actor) != len(self.actions):
|
|
74
|
+
actor.set(ActorPermissions('0'*len(self.actions)))
|
|
75
|
+
else:
|
|
76
|
+
"""lenght is correct, change is not required """
|
|
77
|
+
else:
|
|
78
|
+
"""not was loaded"""
|
|
@@ -1,34 +1,50 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from
|
|
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
|
-
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from typing import Protocol, runtime_checkable
|
|
3
|
+
from ...types import cdt, cst, ut
|
|
4
|
+
from ... import pdu_enums as pdu
|
|
5
|
+
from ...types.type_alias import Obis
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AccessMode(cdt.Enum, ABC):
|
|
9
|
+
""" TODO: """
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def is_writable(self) -> bool:
|
|
12
|
+
...
|
|
13
|
+
|
|
14
|
+
@abstractmethod
|
|
15
|
+
def is_readable(self) -> bool:
|
|
16
|
+
...
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AttributeAccessItem(cdt.Structure, ABC):
|
|
20
|
+
""" Implemented attribute and it access . Use in Association LN """
|
|
21
|
+
attribute_id: cdt.Integer
|
|
22
|
+
access_mode: AccessMode
|
|
23
|
+
access_selectors: cdt.NullData # override in version
|
|
24
|
+
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def abstract_marker(self):
|
|
27
|
+
"""dummy abstract marker"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AttributeAccessDescriptor(cdt.Array, ABC):
|
|
31
|
+
""" Array of attribute_access_item """
|
|
32
|
+
TYPE = AttributeAccessItem
|
|
33
|
+
"""override this"""
|
|
34
|
+
|
|
35
|
+
@abstractmethod
|
|
36
|
+
def set_read_access(self, attribute_id: cdt.Integer):
|
|
37
|
+
"""by attribute_id"""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@runtime_checkable
|
|
41
|
+
class ObjectListType(cdt._Array, Protocol):
|
|
42
|
+
""" Array of object_list_element. The range for the client_SAP is 0…0x7F. The range for the server_SAP is 0x000…0x3FFF."""
|
|
43
|
+
|
|
44
|
+
def is_writable(self, obis: Obis, indexes: set[int]) -> bool:
|
|
45
|
+
""" index - DLMS object attribute index.
|
|
46
|
+
True: AccessRight is WriteOnly or ReadAndWrite """
|
|
47
|
+
|
|
48
|
+
def get_attr_access(self, obis: Obis, index: int) -> pdu.AttributeAccess: ...
|
|
49
|
+
|
|
50
|
+
def get_meth_access(self, obis: Obis, index: int) -> pdu.MethodAccess: ...
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
from functools import lru_cache
|
|
2
|
-
from ...types import common_data_types as cdt
|
|
3
|
-
from . import mechanism_id
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class AuthenticationMechanismName(cdt.Structure):
|
|
7
|
-
""" Contains the name of the authentication mechanism for the association (see IEC 62056-53). The authentication mechanism name is specified as an
|
|
8
|
-
OBJECT IDENTIFIER in 7.3.7.2 of IEC 62056-53. The authentication_mechanism_name attribute includes the arc labels of the OBJECT IDENTIFIER. """
|
|
9
|
-
DEFAULT = (2, 16, 756, 5, 8, 2, 0)
|
|
10
|
-
joint_iso_ctt_element: cdt.Unsigned
|
|
11
|
-
country_element: cdt.Unsigned
|
|
12
|
-
country_name_element: cdt.LongUnsigned
|
|
13
|
-
identified_organization_element: cdt.Unsigned
|
|
14
|
-
DLMS_UA_element: cdt.Unsigned
|
|
15
|
-
authentication_mechanism_name_element: cdt.Unsigned
|
|
16
|
-
mechanism_id_element: mechanism_id.MechanismIdElement
|
|
17
|
-
|
|
18
|
-
@classmethod
|
|
19
|
-
@lru_cache(maxsize=32)
|
|
20
|
-
def get_AARQ_mechanism_name(cls, cryptographic: int, algorithm_id: int) -> bytes:
|
|
21
|
-
"""according to DLMS UA 1000-2 Ed. 10 9.4.2.2.4 Cryptographic algorithm ID-s"""
|
|
22
|
-
default = list(AuthenticationMechanismName.DEFAULT)
|
|
23
|
-
default[5] = cryptographic
|
|
24
|
-
default[6] = algorithm_id
|
|
25
|
-
return AuthenticationMechanismName(tuple(default)).get_a_xdr()
|
|
1
|
+
from functools import lru_cache
|
|
2
|
+
from ...types import common_data_types as cdt
|
|
3
|
+
from . import mechanism_id
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AuthenticationMechanismName(cdt.Structure):
|
|
7
|
+
""" Contains the name of the authentication mechanism for the association (see IEC 62056-53). The authentication mechanism name is specified as an
|
|
8
|
+
OBJECT IDENTIFIER in 7.3.7.2 of IEC 62056-53. The authentication_mechanism_name attribute includes the arc labels of the OBJECT IDENTIFIER. """
|
|
9
|
+
DEFAULT = (2, 16, 756, 5, 8, 2, 0)
|
|
10
|
+
joint_iso_ctt_element: cdt.Unsigned
|
|
11
|
+
country_element: cdt.Unsigned
|
|
12
|
+
country_name_element: cdt.LongUnsigned
|
|
13
|
+
identified_organization_element: cdt.Unsigned
|
|
14
|
+
DLMS_UA_element: cdt.Unsigned
|
|
15
|
+
authentication_mechanism_name_element: cdt.Unsigned
|
|
16
|
+
mechanism_id_element: mechanism_id.MechanismIdElement
|
|
17
|
+
|
|
18
|
+
@classmethod
|
|
19
|
+
@lru_cache(maxsize=32)
|
|
20
|
+
def get_AARQ_mechanism_name(cls, cryptographic: int, algorithm_id: int) -> bytes:
|
|
21
|
+
"""according to DLMS UA 1000-2 Ed. 10 9.4.2.2.4 Cryptographic algorithm ID-s"""
|
|
22
|
+
default = list(AuthenticationMechanismName.DEFAULT)
|
|
23
|
+
default[5] = cryptographic
|
|
24
|
+
default[6] = algorithm_id
|
|
25
|
+
return AuthenticationMechanismName(tuple(default)).get_a_xdr()
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
from ...types import cdt
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class MechanismIdElement(cdt.Enum, elements=tuple(range(8))):
|
|
5
|
-
TAG = b'\x11'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class ConstantMixin:
|
|
9
|
-
"""override raise for set"""
|
|
10
|
-
def set(self, *args, **kwargs):
|
|
11
|
-
raise AttributeError(F"not support <set> for {self.__class__.__name__} constant")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class MechanismIdElementConst(ConstantMixin, MechanismIdElement):
|
|
15
|
-
""""""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
NONE = MechanismIdElementConst(0)
|
|
19
|
-
LOW = MechanismIdElementConst(1)
|
|
20
|
-
HIGH = MechanismIdElementConst(2)
|
|
21
|
-
HIGH_MD5 = MechanismIdElementConst(3)
|
|
22
|
-
HIGH_SHA1 = MechanismIdElementConst(4)
|
|
23
|
-
HIGH_GMAC = MechanismIdElementConst(5)
|
|
24
|
-
HIGH_SHA256 = MechanismIdElementConst(6)
|
|
25
|
-
HIGH_ECDSA = MechanismIdElementConst(7)
|
|
1
|
+
from ...types import cdt
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class MechanismIdElement(cdt.Enum, elements=tuple(range(8))):
|
|
5
|
+
TAG = b'\x11'
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ConstantMixin:
|
|
9
|
+
"""override raise for set"""
|
|
10
|
+
def set(self, *args, **kwargs):
|
|
11
|
+
raise AttributeError(F"not support <set> for {self.__class__.__name__} constant")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MechanismIdElementConst(ConstantMixin, MechanismIdElement):
|
|
15
|
+
""""""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
NONE = MechanismIdElementConst(0)
|
|
19
|
+
LOW = MechanismIdElementConst(1)
|
|
20
|
+
HIGH = MechanismIdElementConst(2)
|
|
21
|
+
HIGH_MD5 = MechanismIdElementConst(3)
|
|
22
|
+
HIGH_SHA1 = MechanismIdElementConst(4)
|
|
23
|
+
HIGH_GMAC = MechanismIdElementConst(5)
|
|
24
|
+
HIGH_SHA256 = MechanismIdElementConst(6)
|
|
25
|
+
HIGH_ECDSA = MechanismIdElementConst(7)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from ...types import cdt
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ReplyToHLSAuthentication(cdt.OctetString):
|
|
5
|
-
"""""" # todo: make validate by contents
|
|
1
|
+
from ...types import cdt
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ReplyToHLSAuthentication(cdt.OctetString):
|
|
5
|
+
"""""" # todo: make validate by contents
|