|
| 1 | +import io |
| 2 | +from builtins import bytes |
| 3 | +from builtins import int |
| 4 | +from enum import IntEnum |
| 5 | +from typing import Any |
| 6 | +from typing import Generator |
| 7 | +from typing import NamedTuple |
| 8 | + |
| 9 | +from _typeshed import Incomplete |
| 10 | + |
| 11 | +INDEFINITE_FORM: int |
| 12 | + |
| 13 | +class Asn1Enum(IntEnum): ... |
| 14 | + |
| 15 | +class Numbers(Asn1Enum): |
| 16 | + Boolean = 1 |
| 17 | + Integer = 2 |
| 18 | + BitString = 3 |
| 19 | + OctetString = 4 |
| 20 | + Null = 5 |
| 21 | + ObjectIdentifier = 6 |
| 22 | + ObjectDescriptor = 7 |
| 23 | + External = 8 |
| 24 | + Real = 9 |
| 25 | + Enumerated = 10 |
| 26 | + EmbeddedPDV = 11 |
| 27 | + UTF8String = 12 |
| 28 | + RelativeOID = 13 |
| 29 | + Time = 14 |
| 30 | + Sequence = 16 |
| 31 | + Set = 17 |
| 32 | + NumericString = 18 |
| 33 | + PrintableString = 19 |
| 34 | + T61String = 20 |
| 35 | + VideotextString = 21 |
| 36 | + IA5String = 22 |
| 37 | + UTCTime = 23 |
| 38 | + GeneralizedTime = 24 |
| 39 | + GraphicString = 25 |
| 40 | + VisibleString = 26 |
| 41 | + GeneralString = 27 |
| 42 | + UniversalString = 28 |
| 43 | + CharacterString = 29 |
| 44 | + UnicodeString = 30 |
| 45 | + Date = 31 |
| 46 | + TimeOfDay = 32 |
| 47 | + DateTime = 33 |
| 48 | + Duration = 34 |
| 49 | + OIDinternationalized = 35 |
| 50 | + RelativeOIDinternationalized = 36 |
| 51 | + |
| 52 | +class Types(Asn1Enum): |
| 53 | + Constructed = 32 |
| 54 | + Primitive = 0 |
| 55 | + |
| 56 | +class Classes(Asn1Enum): |
| 57 | + Universal = 0 |
| 58 | + Application = 64 |
| 59 | + Context = 128 |
| 60 | + Private = 192 |
| 61 | + |
| 62 | +class ReadFlags(IntEnum): |
| 63 | + OnlyValue = 0 |
| 64 | + WithUnused = 1 |
| 65 | + |
| 66 | +class Tag(NamedTuple): |
| 67 | + nr: Incomplete |
| 68 | + typ: Incomplete |
| 69 | + cls: Incomplete |
| 70 | + |
| 71 | +def to_int_2c(values: bytes) -> int: ... |
| 72 | +def to_bytes_2c(value: int) -> bytes: ... |
| 73 | +def shift_bits_right(values, unused): ... |
| 74 | +def is_negative_zero(x): ... |
| 75 | +def is_positive_infinity(x): ... |
| 76 | +def is_negative_infinity(x): ... |
| 77 | +def is_nan(x): ... |
| 78 | +def is_iterable(value): ... |
| 79 | + |
| 80 | +class Error(Exception): ... |
| 81 | + |
| 82 | +class Encoder: |
| 83 | + def __init__(self) -> None: ... |
| 84 | + def start(self, stream: io.RawIOBase | None = None) -> None: ... |
| 85 | + def enter(self, nr: int, cls: int | None = None) -> None: ... |
| 86 | + def leave(self) -> None: ... |
| 87 | + def construct(self, nr: int, cls: int | None = None) -> Generator[None, Any, None]: ... |
| 88 | + def write(self, value: Any, nr: int | None = None, typ: int | None = None, cls: int | None = None) -> None: ... |
| 89 | + def output(self) -> bytes: ... |
| 90 | + |
| 91 | +class Decoder: |
| 92 | + def __init__(self) -> None: ... |
| 93 | + def start(self, stream: io.RawIOBase | bytes) -> None: ... |
| 94 | + def peek(self) -> Tag | None: ... |
| 95 | + def read(self, flags: ReadFlags = ...) -> tuple[Tag | None, Any]: ... |
| 96 | + def eof(self) -> bool: ... |
| 97 | + def enter(self) -> None: ... |
| 98 | + def leave(self) -> None: ... |
0 commit comments