2 from logging import Logger
3 from socket import socket
4 from typing import Any, Callable
6 from cryptography.hazmat.primitives.ciphers import Cipher
7 from paramiko.compress import ZlibCompressor, ZlibDecompressor
8 from paramiko.message import Message
10 if sys.version_info >= (3, 0):
11 from hashlib import _Hash
13 from hashlib import _hash as _Hash
15 def compute_hmac(key: bytes, message: bytes, digest_class: _Hash) -> bytes: ...
17 class NeedRekeyException(Exception): ...
19 def first_arg(e: Exception) -> Any: ...
24 REKEY_PACKETS_OVERFLOW_MAX: int
25 REKEY_BYTES_OVERFLOW_MAX: int
26 def __init__(self, socket: socket) -> None: ...
28 def closed(self) -> bool: ...
29 def set_log(self, log: Logger) -> None: ...
30 def set_outbound_cipher(
40 def set_inbound_cipher(
41 self, block_engine: Cipher, block_size: int, mac_engine: _Hash, mac_size: int, mac_key: bytes, etm: bool = ...
43 def set_outbound_compressor(self, compressor: ZlibCompressor) -> None: ...
44 def set_inbound_compressor(self, compressor: ZlibDecompressor) -> None: ...
45 def close(self) -> None: ...
46 def set_hexdump(self, hexdump: bool) -> None: ...
47 def get_hexdump(self) -> bool: ...
48 def get_mac_size_in(self) -> int: ...
49 def get_mac_size_out(self) -> int: ...
50 def need_rekey(self) -> bool: ...
51 def set_keepalive(self, interval: int, callback: Callable[[], None]) -> None: ...
52 def read_timer(self) -> None: ...
53 def start_handshake(self, timeout: float) -> None: ...
54 def handshake_timed_out(self) -> bool: ...
55 def complete_handshake(self) -> None: ...
56 def read_all(self, n: int, check_rekey: bool = ...) -> bytes: ...
57 def write_all(self, out: bytes) -> None: ...
58 def readline(self, timeout: float) -> str: ...
59 def send_message(self, data: Message) -> None: ...
60 def read_message(self) -> tuple[int, Message]: ...