File: oids.pyi

package info (click to toggle)
python-gssapi 1.10.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 876 kB
  • sloc: python: 3,707; sh: 198; makefile: 154; ansic: 60
file content (50 lines) | stat: -rw-r--r-- 1,360 bytes parent folder | download | duplicates (3)
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
import typing as t

class OID:
    """
    A GSSAPI OID

    A new OID may be created by passing the `elements` argument
    to the constructor.  The `elements` argument should be a
    :class:`bytes` consisting of the BER-encoded values in the OID.

    To retrieve the underlying bytes, use the :class:`bytes`
    function in Python 3.

    This object is hashable, and may be compared using equality
    operators.
    """

    def __new__(
        cls,
        cpy: t.Optional["OID"] = None,
        elements: t.Optional[bytes] = None,
    ) -> "OID": ...

    @classmethod
    def from_int_seq(
        cls,
        integer_sequence: t.Union[str, t.Iterable[int]],
    ) -> "OID":
        """Create a OID from a sequence of integers.

        This method creates an OID from a sequence of integers.
        The sequence can either be in dotted form as a string,
        or in list form.

        This method is not for BER-encoded byte strings, which
        can be passed directly to the OID constructor.

        Args:
            integer_sequence: either a list of integers or
                a string in dotted form

        Returns:
            OID: the OID represented by the given integer sequence

        Raises:
            ValueError: the sequence is less than two elements long
        """

    @property
    def dotted_form(self) -> str: ...