massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / paramiko / paramiko / hostkeys.pyi
1 from typing import Iterator, Mapping, MutableMapping
2
3 from paramiko.pkey import PKey
4
5 class _SubDict(MutableMapping[str, PKey]):
6     # Internal to HostKeys.lookup()
7     def __init__(self, hostname: str, entries: list[HostKeyEntry], hostkeys: HostKeys) -> None: ...
8     def __iter__(self) -> Iterator[str]: ...
9     def __len__(self) -> int: ...
10     def __delitem__(self, key: str) -> None: ...
11     def __getitem__(self, key: str) -> PKey: ...
12     def __setitem__(self, key: str, val: PKey) -> None: ...
13     def keys(self) -> list[str]: ...  # type: ignore
14
15 class HostKeys(MutableMapping[str, _SubDict]):
16     def __init__(self, filename: str | None = ...) -> None: ...
17     def add(self, hostname: str, keytype: str, key: PKey) -> None: ...
18     def load(self, filename: str) -> None: ...
19     def save(self, filename: str) -> None: ...
20     def lookup(self, hostname: str) -> _SubDict | None: ...
21     def check(self, hostname: str, key: PKey) -> bool: ...
22     def clear(self) -> None: ...
23     def __iter__(self) -> Iterator[str]: ...
24     def __len__(self) -> int: ...
25     def __getitem__(self, key: str) -> _SubDict: ...
26     def __delitem__(self, key: str) -> None: ...
27     def __setitem__(self, hostname: str, entry: Mapping[str, PKey]) -> None: ...
28     def keys(self) -> list[str]: ...  # type: ignore
29     def values(self) -> list[_SubDict]: ...  # type: ignore
30     @staticmethod
31     def hash_host(hostname: str, salt: str | None = ...) -> str: ...
32
33 class InvalidHostKey(Exception):
34     line: str
35     exc: Exception
36     def __init__(self, line: str, exc: Exception) -> None: ...
37
38 class HostKeyEntry:
39     valid: bool
40     hostnames: str
41     key: PKey
42     def __init__(self, hostnames: list[str] | None = ..., key: PKey | None = ...) -> None: ...
43     @classmethod
44     def from_line(cls, line: str, lineno: int | None = ...) -> HostKeyEntry | None: ...
45     def to_line(self) -> str | None: ...