]> Cypherpunks.ru repositories - pyderasn.git/blob - pyderasn.pyi
Decode context and defines feature extending
[pyderasn.git] / pyderasn.pyi
1 from datetime import datetime
2 from typing import Any as TAny
3 from typing import Dict
4 from typing import NamedTuple
5 from typing import Optional
6 from typing import Sequence as TSequence
7 from typing import Tuple
8 from typing import Type
9 from typing import Union
10
11
12 TagClassUniversal = ...  # type: int
13 TagClassApplication = ...  # type: int
14 TagClassContext = ...  # type: int
15 TagClassPrivate = ...  # type: int
16 TagFormPrimitive = ...  # type: int
17 TagFormConstructed = ...  # type: int
18 TagClassReprs = ...  # type: Dict[int, str]
19
20
21 class DecodeError(Exception):
22     msg = ...  # type: str
23     klass = ...  # type: Type
24     decode_path = ...  # type: Tuple[str, ...]
25     offset = ...  # type: int
26
27     def __init__(
28             self,
29             msg: str=...,
30             klass: Optional[TAny]=...,
31             decode_path: TAny=...,
32             offset: int=...,
33     ) -> None: ...
34
35 class NotEnoughData(DecodeError): ...
36
37 class TagMismatch(DecodeError): ...
38
39 class InvalidLength(DecodeError): ...
40
41 class InvalidOID(DecodeError): ...
42
43 class ObjUnknown(ValueError):
44     name = ...  # type: str
45
46     def __init__(self, name: str) -> None: ...
47
48 class ObjNotReady(ValueError):
49     name = ...  # type: str
50
51     def __init__(self, str) -> None: ...
52
53 class InvalidValueType(ValueError):
54     expected_types = ...  # type: Tuple[Type, ...]
55
56     def __init__(self, expected_types: Tuple[Type, ...]) -> None: ...
57
58 class BoundsError(ValueError):
59     bound_min = ...  # type: int
60     value = ...  # type: int
61     bound_max = ...  # type: int
62
63     def __init__(self, bound_min: int, value: int, bound_max: int) -> None: ...
64
65 def hexdec(data: str) -> bytes: ...
66
67 def hexenc(data: bytes) -> str: ...
68
69 def int_bytes_len(num: int, byte_len: int=...) -> int: ...
70
71 def zero_ended_encode(num: int) -> bytes: ...
72
73 def tag_encode(num: int, klass: int=..., form: int=...) -> bytes: ...
74
75 def tag_decode(tag: bytes) -> Tuple[int, int, int]: ...
76
77 def tag_ctxp(num: int) -> bytes: ...
78
79 def tag_ctxc(num: int) -> bytes: ...
80
81 def tag_strip(data: memoryview) -> Tuple[memoryview, int, memoryview]: ...
82
83 def len_encode(l: int) -> bytes: ...
84
85 def len_decode(data: memoryview) -> Tuple[int, int, memoryview]: ...
86
87 class Obj:
88     tag = ...  # type: bytes
89     optional = ...  # type: bool
90
91     def __init__(
92             self,
93             impl: Optional[bytes]=...,
94             expl: Optional[bytes]=...,
95             default: Optional[TAny]=...,
96             optional: bool=...,
97     ) -> None: ...
98
99     @property
100     def ready(self) -> bool: ...
101
102     @property
103     def decoded(self) -> bool: ...
104
105     def copy(self) -> "Obj": ...
106
107     @property
108     def tlen(self) -> int: ...
109
110     @property
111     def tlvlen(self) -> int: ...
112
113     def encode(self) -> bytes: ...
114
115     def decode(
116             self,
117             data: bytes,
118             offset: int=...,
119             leavemm: bool=...,
120             decode_path: Tuple[str, ...]=...,
121             ctx: Optional[Dict[str, TAny]]=...,
122     ) -> Tuple[Obj, bytes]: ...
123
124     @property
125     def expled(self) -> bool: ...
126
127     @property
128     def expl_tag(self) -> bytes: ...
129
130     @property
131     def expl_tlen(self) -> int: ...
132
133     @property
134     def expl_llen(self) -> int: ...
135
136     @property
137     def expl_offset(self) -> int: ...
138
139     @property
140     def expl_vlen(self) -> int: ...
141
142     @property
143     def expl_tlvlen(self) -> int: ...
144
145
146 PP = NamedTuple("PP", (
147     ("asn1_type_name", str),
148     ("obj_name", str),
149     ("decode_path", Tuple[str, ...]),
150     ("value", Optional[str]),
151     ("blob", Optional[Union[bytes, Tuple[str, ...]]]),
152     ("optional", bool),
153     ("default", bool),
154     ("impl", Optional[Tuple[int, int, int]]),
155     ("expl", Optional[Tuple[int, int, int]]),
156     ("offset", int),
157     ("tlen", int),
158     ("llen", int),
159     ("vlen", int),
160     ("expl_offset", int),
161     ("expl_tlen", int),
162     ("expl_llen", int),
163     ("expl_vlen", int),
164 ))
165
166
167 def pp_console_row(
168         pp: PP,
169         oids: Optional[Dict[str, str]]=...,
170         with_offsets: bool=...,
171         with_blob: bool=...,
172 ): ...
173
174 def pp_console_blob(pp: PP) -> TSequence[str]: ...
175
176 def pprint(
177         obj: Obj,
178         oids: Optional[Dict[str, str]]=...,
179         big_blobs: bool=...,
180 ): ...
181
182
183 class Boolean(Obj):
184     tag_default = ...  # type: bytes
185     asn1_type_name = ...  # type: str
186     default = ...  # type: "Boolean"
187     optional = ...  # type: bool
188
189     def __init__(
190             self,
191             value: Optional[Union["Boolean", bool]]=...,
192             impl: Optional[bytes]=...,
193             expl: Optional[bytes]=...,
194             default: Optional[Union["Boolean", bool]]=...,
195             optional: bool=...,
196     ) -> None: ...
197
198     @property
199     def ready(self) -> bool: ...
200
201     def copy(self) -> "Boolean": ...
202
203     def __call__(
204             self,
205             value: Optional[Union["Boolean", bool]]=...,
206             impl: Optional[bytes]=...,
207             expl: Optional[bytes]=...,
208             default: Optional[Union["Boolean", bool]]=...,
209             optional: Optional[bool]=...,
210     ) -> "Boolean": ...
211
212     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
213
214
215 class Integer(Obj):
216     tag_default = ...  # type: bytes
217     asn1_type_name = ...  # type: str
218     specs = ...  # type: Dict[str, int]
219     default = ...  # type: "Integer"
220     optional = ...  # type: bool
221
222     def __init__(
223             self,
224             value: Optional[Union["Integer", int, str]]=...,
225             bounds: Optional[Tuple[int, int]]=...,
226             impl: Optional[bytes]=...,
227             expl: Optional[bytes]=...,
228             default: Optional[Union["Integer", int, str]]=...,
229             optional: bool=...,
230     ) -> None: ...
231
232     @property
233     def ready(self) -> bool: ...
234
235     def copy(self) -> "Integer": ...
236
237     @property
238     def named(self) -> Optional[str]: ...
239
240     def __call__(
241             self,
242             value: Optional[Union["Integer", int, str]]=...,
243             bounds: Optional[Tuple[int, int]]=...,
244             impl: Optional[bytes]=...,
245             expl: Optional[bytes]=...,
246             default: Optional[Union["Integer", int, str]]=...,
247             optional: Optional[bool]=...,
248     ) -> "Integer": ...
249
250     def __int__(self) -> int: ...
251
252     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
253
254
255 class BitString(Obj):
256     tag_default = ...  # type: bytes
257     asn1_type_name = ...  # type: str
258     specs = ...  # type: Dict[str, int]
259     default = ...  # type: "BitString"
260     optional = ...  # type: bool
261
262     def __init__(
263             self,
264             value: Optional[Union["BitString", bytes, Tuple[str, ...]]]=...,
265             impl: Optional[bytes]=...,
266             expl: Optional[bytes]=...,
267             default: Optional[Union["BitString", bytes, Tuple[str, ...]]]=...,
268             optional: bool=...,
269     ) -> None: ...
270
271     @property
272     def ready(self) -> bool: ...
273
274     def copy(self) -> "BitString": ...
275
276     @property
277     def bit_len(self) -> int: ...
278
279     @property
280     def named(self) -> TSequence[str]: ...
281
282     def __call__(
283             self,
284             value: Optional[Union["BitString", bytes, Tuple[str, ...]]]=...,
285             impl: Optional[bytes]=...,
286             expl: Optional[bytes]=...,
287             default: Optional[Union["BitString", bytes, Tuple[str, ...]]]=...,
288             optional: Optional[bool]=...,
289     ) -> "BitString": ...
290
291     def __bytes__(self) -> bytes: ...
292
293     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
294
295
296 class OctetString(Obj):
297     tag_default = ...  # type: bytes
298     asn1_type_name = ...  # type: str
299     default = ...  # type: "OctetString"
300     optional = ...  # type: bool
301     defined = ...  # type: Tuple[ObjectIdentifier, Obj]
302
303     def __init__(
304             self,
305             value: Optional[Union["OctetString", bytes]]=...,
306             bounds: Optional[Tuple[int, int]]=...,
307             impl: Optional[bytes]=...,
308             expl: Optional[bytes]=...,
309             default: Optional[Union["OctetString", bytes]]=...,
310             optional: bool=...,
311     ) -> None: ...
312
313     @property
314     def ready(self) -> bool: ...
315
316     def copy(self) -> "OctetString": ...
317
318     def __call__(
319             self,
320             value: Optional[Union["OctetString", bytes]]=...,
321             bounds: Optional[Tuple[int, int]]=...,
322             impl: Optional[bytes]=...,
323             expl: Optional[bytes]=...,
324             default: Optional[Union["OctetString", bytes]]=...,
325             optional: Optional[bool]=...,
326     ) -> "OctetString": ...
327
328     def __bytes__(self) -> bytes: ...
329
330     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
331
332
333 class Null(Obj):
334     tag_default = ...  # type: bytes
335     asn1_type_name = ...  # type: str
336     default = ...  # type: "Null"
337     optional = ...  # type: bool
338
339     def __init__(
340             self,
341             impl: Optional[bytes]=...,
342             expl: Optional[bytes]=...,
343             optional: bool=...,
344     ) -> None: ...
345
346     @property
347     def ready(self) -> bool: ...
348
349     def copy(self) -> "Null": ...
350
351     def __call__(
352             self,
353             impl: Optional[bytes]=...,
354             expl: Optional[bytes]=...,
355             optional: Optional[bool]=...,
356     ) -> "Null": ...
357
358     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
359
360
361 class ObjectIdentifier(Obj):
362     tag_default = ...  # type: bytes
363     asn1_type_name = ...  # type: str
364     default = ...  # type: "ObjectIdentifier"
365     optional = ...  # type: bool
366
367     def __init__(
368             self,
369             value: Optional[Union["ObjectIdentifier", str, Tuple[int, ...]]]=...,
370             defines: Optional[Sequence[Tuple[str, Dict["ObjectIdentifier", Obj]]]],
371             impl: Optional[bytes]=...,
372             expl: Optional[bytes]=...,
373             default: Optional[Union["ObjectIdentifier", str, Tuple[int, ...]]]=...,
374             optional: bool=...,
375     ) -> None: ...
376
377     @property
378     def ready(self) -> bool: ...
379
380     def copy(self) -> "ObjectIdentifier": ...
381
382     def __call__(
383             self,
384             value: Optional[Union["ObjectIdentifier", str, Tuple[int, ...]]]=...,
385             impl: Optional[bytes]=...,
386             expl: Optional[bytes]=...,
387             default: Optional[Union["ObjectIdentifier", str, Tuple[int, ...]]]=...,
388             optional: Optional[bool]=...,
389     ) -> "ObjectIdentifier": ...
390
391     def __add__(
392             self,
393             their: Union["ObjectIdentifier", Tuple[int, ...]],
394     ) -> "ObjectIdentifier": ...
395
396     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
397
398
399 class Enumerated(Integer):
400     tag_default = ...  # type: bytes
401     asn1_type_name = ...  # type: str
402     default = ...  # type: "Enumerated"
403     optional = ...  # type: bool
404
405     def __init__(
406             self,
407             value: Optional[Union["Enumerated", str, int]]=...,
408             impl: Optional[bytes]=...,
409             expl: Optional[bytes]=...,
410             default: Optional[Union["Enumerated", str, int]]=...,
411             optional: bool=...,
412     ) -> None: ...
413
414     def copy(self) -> "Enumerated": ...
415
416     def __call__(  # type: ignore
417             self,
418             value: Optional[Union["Enumerated", str, int]]=...,
419             impl: Optional[bytes]=...,
420             expl: Optional[bytes]=...,
421             default: Optional[Union["Enumerated", str, int]]=...,
422             optional: Optional[bool]=...,
423     ) -> "Enumerated": ...
424
425
426 class CommonString(OctetString):
427     def pps(
428             self,
429             decode_path: Tuple[str, ...]=...,
430             no_unicode: bool=...,
431     ) -> TSequence[PP]: ...
432
433
434 class UTF8String(CommonString):
435     tag_default = ...  # type: bytes
436     encoding = ...  # type: str
437     asn1_type_name = ...  # type: str
438     default = ...  # type: "UTF8String"
439     optional = ...  # type: bool
440
441     def __init__(
442             self,
443             value: Optional[Union["UTF8String", str, bytes]]=...,
444             bounds: Optional[Tuple[int, int]]=...,
445             impl: Optional[bytes]=...,
446             expl: Optional[bytes]=...,
447             default: Optional[Union["UTF8String", str, bytes]]=...,
448             optional: bool=...,
449     ) -> None: ...
450
451     def __str__(self) -> str: ...
452
453
454 class NumericString(CommonString):
455     tag_default = ...  # type: bytes
456     encoding = ...  # type: str
457     asn1_type_name = ...  # type: str
458     default = ...  # type: "NumericString"
459     optional = ...  # type: bool
460
461     def __init__(
462             self,
463             value: Optional[Union["NumericString", str, bytes]]=...,
464             bounds: Optional[Tuple[int, int]]=...,
465             impl: Optional[bytes]=...,
466             expl: Optional[bytes]=...,
467             default: Optional[Union["NumericString", str, bytes]]=...,
468             optional: bool=...,
469     ) -> None: ...
470
471
472 class PrintableString(CommonString):
473     tag_default = ...  # type: bytes
474     encoding = ...  # type: str
475     asn1_type_name = ...  # type: str
476     default = ...  # type: "PrintableString"
477     optional = ...  # type: bool
478
479     def __init__(
480             self,
481             value: Optional[Union["PrintableString", str, bytes]]=...,
482             bounds: Optional[Tuple[int, int]]=...,
483             impl: Optional[bytes]=...,
484             expl: Optional[bytes]=...,
485             default: Optional[Union["PrintableString", str, bytes]]=...,
486             optional: bool=...,
487     ) -> None: ...
488
489
490 class TeletexString(CommonString):
491     tag_default = ...  # type: bytes
492     encoding = ...  # type: str
493     asn1_type_name = ...  # type: str
494     default = ...  # type: "TeletexString"
495     optional = ...  # type: bool
496
497     def __init__(
498             self,
499             value: Optional[Union["TeletexString", str, bytes]]=...,
500             bounds: Optional[Tuple[int, int]]=...,
501             impl: Optional[bytes]=...,
502             expl: Optional[bytes]=...,
503             default: Optional[Union["TeletexString", str, bytes]]=...,
504             optional: bool=...,
505     ) -> None: ...
506
507
508 class T61String(TeletexString):
509     asn1_type_name = ...  # type: str
510     default = ...  # type: "T61String"
511     optional = ...  # type: bool
512
513
514 class VideotexString(CommonString):
515     tag_default = ...  # type: bytes
516     encoding = ...  # type: str
517     asn1_type_name = ...  # type: str
518     default = ...  # type: "VideotexString"
519     optional = ...  # type: bool
520
521     def __init__(
522             self,
523             value: Optional[Union["VideotexString", str, bytes]]=...,
524             bounds: Optional[Tuple[int, int]]=...,
525             impl: Optional[bytes]=...,
526             expl: Optional[bytes]=...,
527             default: Optional[Union["VideotexString", str, bytes]]=...,
528             optional: bool=...,
529     ) -> None: ...
530
531
532 class IA5String(CommonString):
533     tag_default = ...  # type: bytes
534     encoding = ...  # type: str
535     asn1_type_name = ...  # type: str
536     default = ...  # type: "IA5String"
537     optional = ...  # type: bool
538
539     def __init__(
540             self,
541             value: Optional[Union["IA5String", str, bytes]]=...,
542             bounds: Optional[Tuple[int, int]]=...,
543             impl: Optional[bytes]=...,
544             expl: Optional[bytes]=...,
545             default: Optional[Union["IA5String", str, bytes]]=...,
546             optional: bool=...,
547     ) -> None: ...
548
549
550 class UTCTime(CommonString):
551     tag_default = ...  # type: bytes
552     encoding = ...  # type: str
553     asn1_type_name = ...  # type: str
554     default = ...  # type: "UTCTime"
555     optional = ...  # type: bool
556
557     def __init__(
558             self,
559             value: Optional[Union["UTCTime", datetime]]=...,
560             impl: Optional[bytes]=...,
561             expl: Optional[bytes]=...,
562             default: Optional[Union["UTCTime", datetime]]=...,
563             optional: bool=...,
564     ) -> None: ...
565
566     def todatetime(self) -> datetime: ...
567
568     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...  # type: ignore
569
570
571 class GeneralizedTime(UTCTime):
572     tag_default = ...  # type: bytes
573     asn1_type_name = ...  # type: str
574     default = ...  # type: "GeneralizedTime"
575     optional = ...  # type: bool
576
577     def todatetime(self) -> datetime: ...
578
579
580 class GraphicString(CommonString):
581     tag_default = ...  # type: bytes
582     encoding = ...  # type: str
583     asn1_type_name = ...  # type: str
584     default = ...  # type: "GraphicString"
585     optional = ...  # type: bool
586
587     def __init__(
588             self,
589             value: Optional[Union["GraphicString", str, bytes]]=...,
590             bounds: Optional[Tuple[int, int]]=...,
591             impl: Optional[bytes]=...,
592             expl: Optional[bytes]=...,
593             default: Optional[Union["GraphicString", str, bytes]]=...,
594             optional: bool=...,
595     ) -> None: ...
596
597
598 class VisibleString(CommonString):
599     tag_default = ...  # type: bytes
600     encoding = ...  # type: str
601     asn1_type_name = ...  # type: str
602     default = ...  # type: "VisibleString"
603     optional = ...  # type: bool
604
605     def __init__(
606             self,
607             value: Optional[Union["VisibleString", str, bytes]]=...,
608             bounds: Optional[Tuple[int, int]]=...,
609             impl: Optional[bytes]=...,
610             expl: Optional[bytes]=...,
611             default: Optional[Union["VisibleString", str, bytes]]=...,
612             optional: bool=...,
613     ) -> None: ...
614
615
616 class ISO646String(VisibleString):
617     asn1_type_name = ...  # type: str
618     default = ...  # type: "ISO646String"
619     optional = ...  # type: bool
620
621
622 class GeneralString(CommonString):
623     tag_default = ...  # type: bytes
624     encoding = ...  # type: str
625     asn1_type_name = ...  # type: str
626     default = ...  # type: "GeneralString"
627     optional = ...  # type: bool
628
629     def __init__(
630             self,
631             value: Optional[Union["GeneralString", str, bytes]]=...,
632             bounds: Optional[Tuple[int, int]]=...,
633             impl: Optional[bytes]=...,
634             expl: Optional[bytes]=...,
635             default: Optional[Union["GeneralString", str, bytes]]=...,
636             optional: bool=...,
637     ) -> None: ...
638
639
640 class UniversalString(CommonString):
641     tag_default = ...  # type: bytes
642     encoding = ...  # type: str
643     asn1_type_name = ...  # type: str
644     default = ...  # type: "UniversalString"
645     optional = ...  # type: bool
646
647     def __init__(
648             self,
649             value: Optional[Union["UniversalString", str, bytes]]=...,
650             bounds: Optional[Tuple[int, int]]=...,
651             impl: Optional[bytes]=...,
652             expl: Optional[bytes]=...,
653             default: Optional[Union["UniversalString", str, bytes]]=...,
654             optional: bool=...,
655     ) -> None: ...
656
657
658 class BMPString(CommonString):
659     tag_default = ...  # type: bytes
660     encoding = ...  # type: str
661     asn1_type_name = ...  # type: str
662     default = ...  # type: "BMPString"
663     optional = ...  # type: bool
664
665     def __init__(
666             self,
667             value: Optional[Union["BMPString", str, bytes]]=...,
668             bounds: Optional[Tuple[int, int]]=...,
669             impl: Optional[bytes]=...,
670             expl: Optional[bytes]=...,
671             default: Optional[Union["BMPString", str, bytes]]=...,
672             optional: bool=...,
673     ) -> None: ...
674
675
676 class Choice(Obj):
677     tag_default = ...  # type: bytes
678     asn1_type_name = ...  # type: str
679     specs = ...  # type: Dict[str, Obj]
680     default = ...  # type: "Choice"
681     optional = ...  # type: bool
682
683     def __init__(
684             self,
685             value: Optional[Union["Choice", Tuple[str, Obj]]]=...,
686             impl: Optional[bytes]=...,
687             expl: Optional[bytes]=...,
688             default: Optional[Union["Choice", Tuple[str, Obj]]]=...,
689             optional: bool=...,
690     ) -> None: ...
691
692     @property
693     def ready(self) -> bool: ...
694
695     def copy(self) -> "Choice": ...
696
697     def __call__(
698             self,
699             value: Optional[Union["Choice", Tuple[str, Obj]]]=...,
700             expl: Optional[bytes]=...,
701             default: Optional[Union["Choice", Tuple[str, Obj]]]=...,
702             optional: Optional[bool]=...,
703     ) -> "Choice": ...
704
705     def __getitem__(self, key: str) -> Optional[Obj]: ...
706
707     def __setitem__(self, key: str, value: Obj) -> None: ...
708
709     @property
710     def choice(self) -> str: ...
711
712     @property
713     def value(self) -> Obj: ...
714
715     @property
716     def tlen(self) -> int: ...
717
718     @property
719     def decoded(self) -> bool: ...
720
721     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
722
723
724 class PrimitiveTypes(Choice):
725     schema = ...  # type: Dict[str, Obj]
726
727
728 class Any(Obj):
729     tag_default = ...  # type: bytes
730     asn1_type_name = ...  # type: str
731     default = ...  # type: "Any"
732     optional = ...  # type: bool
733     defined = ...  # type: Tuple[ObjectIdentifier, Obj]
734
735     def __init__(
736             self,
737             value: Optional[Union[Obj, bytes]]=...,
738             expl: Optional[bytes]=...,
739             optional: bool=...,
740     ) -> None: ...
741
742     @property
743     def ready(self) -> bool: ...
744
745     def copy(self) -> "Any": ...
746
747     def __call__(
748             self,
749             value: Optional[Union[Obj, bytes]]=...,
750             expl: Optional[bytes]=...,
751             optional: Optional[bool]=...,
752     ) -> "Any": ...
753
754     def __bytes__(self) -> bytes: ...
755
756     @property
757     def tlen(self) -> int: ...
758
759     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
760
761
762 class Sequence(Obj):
763     tag_default = ...  # type: bytes
764     asn1_type_name = ...  # type: str
765     specs = ...  # type: Dict[str, Obj]
766     default = ...  # type: "Sequence"
767     optional = ...  # type: bool
768
769     def __init__(
770             self,
771             value: Optional["Sequence"]=...,
772             impl: Optional[bytes]=...,
773             expl: Optional[bytes]=...,
774             default: Optional["Sequence"]=...,
775             optional: bool=...,
776     ) -> None: ...
777
778     @property
779     def ready(self) -> bool: ...
780
781     def copy(self) -> "Sequence": ...
782
783     def __call__(
784             self,
785             value: Optional["Sequence"]=...,
786             impl: Optional[bytes]=...,
787             expl: Optional[bytes]=...,
788             default: Optional["Sequence"]=...,
789             optional: Optional[bool]=...,
790     ) -> "Sequence": ...
791
792     def __getitem__(self, key: str) -> Optional[Obj]: ...
793
794     def __setitem__(self, key: str, value: Obj) -> None: ...
795
796     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
797
798
799 class Set(Sequence):
800     tag_default = ...  # type: bytes
801     asn1_type_name = ...  # type: str
802     default = ...  # type: "Set"
803     optional = ...  # type: bool
804
805
806 class SequenceOf(Obj):
807     tag_default = ...  # type: bytes
808     asn1_type_name = ...  # type: str
809     spec = ...  # type: Obj
810     default = ...  # type: "SequenceOf"
811     optional = ...  # type: bool
812
813     def __init__(
814             self,
815             value: Optional[Union["SequenceOf", TSequence[Obj]]]=...,
816             bounds: Optional[Tuple[int, int]]=...,
817             impl: Optional[bytes]=...,
818             expl: Optional[bytes]=...,
819             default: Optional[Union["SequenceOf", TSequence[Obj]]]=...,
820             optional: Optional[bool]=...,
821     ) -> None: ...
822
823     @property
824     def ready(self) -> bool: ...
825
826     def copy(self) -> "SequenceOf": ...
827
828     def __call__(
829             self,
830             value: Optional[Union["SequenceOf", TSequence[Obj]]]=...,
831             bounds: Optional[Tuple[int, int]]=...,
832             impl: Optional[bytes]=...,
833             expl: Optional[bytes]=...,
834             default: Optional[Union["SequenceOf", TSequence[Obj]]]=...,
835             optional: Optional[bool]=...,
836     ) -> "SequenceOf": ...
837
838     def __getitem__(self, key: int) -> Obj: ...
839
840     def __iter__(self) -> TSequence[Obj]: ...
841
842     def append(self, value: Obj) -> None: ...
843
844     def pps(self, decode_path: Tuple[str, ...]=...) -> TSequence[PP]: ...
845
846
847 class SetOf(SequenceOf):
848     tag_default = ...  # type: bytes
849     asn1_type_name = ...  # type: str
850     default = ...  # type: "SetOf"
851     optional = ...  # type: bool
852
853
854 def obj_by_path(pypath: str) -> TAny: ...