OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
third_party
/
pyasn1
/
pyasn1
/
type
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:48 AM
rwxr-xr-x
📄
__init__.py
59 bytes
11/26/2024 05:32:57 PM
rw-r--r--
📁
__pycache__
-
02/11/2025 08:19:48 AM
rwxr-xr-x
📄
base.py
21.53 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
char.py
9.22 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
constraint.py
21.4 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
error.py
259 bytes
11/26/2024 05:32:57 PM
rw-r--r--
📄
namedtype.py
15.8 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
namedval.py
4.78 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
opentype.py
2.79 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
tag.py
9.27 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
tagmap.py
2.93 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
univ.py
106.65 KB
11/26/2024 05:32:57 PM
rw-r--r--
📄
useful.py
5.16 KB
11/26/2024 05:32:57 PM
rw-r--r--
Editing: opentype.py
Close
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com> # License: https://pyasn1.readthedocs.io/en/latest/license.html # __all__ = ['OpenType'] class OpenType(object): """Create ASN.1 type map indexed by a value The *OpenType* object models an untyped field of a constructed ASN.1 type. In ASN.1 syntax it is usually represented by the `ANY DEFINED BY` for scalars or `SET OF ANY DEFINED BY`, `SEQUENCE OF ANY DEFINED BY` for container types clauses. Typically used together with :class:`~pyasn1.type.univ.Any` object. OpenType objects duck-type a read-only Python :class:`dict` objects, however the passed `typeMap` is not copied, but stored by reference. That means the user can manipulate `typeMap` at run time having this reflected on *OpenType* object behavior. The |OpenType| class models an untyped field of a constructed ASN.1 type. In ASN.1 syntax it is usually represented by the `ANY DEFINED BY` for scalars or `SET OF ANY DEFINED BY`, `SEQUENCE OF ANY DEFINED BY` for container types clauses. Typically used with :class:`~pyasn1.type.univ.Any` type. Parameters ---------- name: :py:class:`str` Field name typeMap: :py:class:`dict` A map of value->ASN.1 type. It's stored by reference and can be mutated later to register new mappings. Examples -------- For untyped scalars: .. code-block:: python openType = OpenType( 'id', {1: Integer(), 2: OctetString()} ) Sequence( componentType=NamedTypes( NamedType('id', Integer()), NamedType('blob', Any(), openType=openType) ) ) For untyped `SET OF` or `SEQUENCE OF` vectors: .. code-block:: python openType = OpenType( 'id', {1: Integer(), 2: OctetString()} ) Sequence( componentType=NamedTypes( NamedType('id', Integer()), NamedType('blob', SetOf(componentType=Any()), openType=openType) ) ) """ def __init__(self, name, typeMap=None): self.__name = name if typeMap is None: self.__typeMap = {} else: self.__typeMap = typeMap @property def name(self): return self.__name # Python dict protocol def values(self): return self.__typeMap.values() def keys(self): return self.__typeMap.keys() def items(self): return self.__typeMap.items() def __contains__(self, key): return key in self.__typeMap def __getitem__(self, key): return self.__typeMap[key] def __iter__(self): return iter(self.__typeMap)