From d27426488ed48fd54290db765702685ca596c0c5 Mon Sep 17 00:00:00 2001 From: dispread <107815346+dispread@users.noreply.github.com> Date: Fri, 24 Nov 2023 18:55:21 +0100 Subject: [PATCH] Added paramiko3.2 PKey and PublicBlob methods (#11067) Addded missing paramiko methods from https://docs.paramiko.org/en/latest/api/keys.html#paramiko.pkey.PKey --- stubs/paramiko/paramiko/pkey.pyi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stubs/paramiko/paramiko/pkey.pyi b/stubs/paramiko/paramiko/pkey.pyi index caba24194..0f26d291a 100644 --- a/stubs/paramiko/paramiko/pkey.pyi +++ b/stubs/paramiko/paramiko/pkey.pyi @@ -1,3 +1,4 @@ +from pathlib import Path from re import Pattern from typing import IO, TypeVar from typing_extensions import Self @@ -14,14 +15,25 @@ class PKey: public_blob: PublicBlob | None BEGIN_TAG: Pattern[str] END_TAG: Pattern[str] + @staticmethod + def from_path(path: Path | str, passphrase: bytes | None = None) -> PKey: ... + @staticmethod + def from_type_string(key_type: str, key_bytes: bytes) -> PKey: ... + @classmethod + def identifiers(cls) -> list[str]: ... def __init__(self, msg: Message | None = None, data: str | None = None) -> None: ... def asbytes(self) -> bytes: ... def __bytes__(self) -> bytes: ... def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... def get_name(self) -> str: ... + @property + def algorithm_name(self) -> str: ... def get_bits(self) -> int: ... def can_sign(self) -> bool: ... def get_fingerprint(self) -> bytes: ... + @property + def fingerprint(self) -> str: ... def get_base64(self) -> str: ... def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ... def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...