Drop support for Python 3.5 (#4675)

Python 3.5 EOL was on 2020-09-30.
This commit is contained in:
Sebastian Rittau
2020-11-02 16:18:20 +01:00
committed by GitHub
parent 57b86e0e71
commit d2a7889fe0
64 changed files with 546 additions and 1174 deletions

View File

@@ -44,11 +44,6 @@ class NoneAlgorithm(Algorithm[None]):
class _HashAlg:
def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ...
if sys.version_info >= (3, 6):
_LoadsString = Union[str, bytes, bytearray]
else:
_LoadsString = str
class HMACAlgorithm(Algorithm[bytes]):
SHA256: ClassVar[_HashAlg]
SHA384: ClassVar[_HashAlg]
@@ -59,7 +54,7 @@ class HMACAlgorithm(Algorithm[bytes]):
@staticmethod
def to_jwk(key_obj: Union[str, bytes]) -> str: ...
@staticmethod
def from_jwk(jwk: _LoadsString) -> bytes: ...
def from_jwk(jwk: Union[str, bytes]) -> bytes: ...
# Only defined if cryptography is installed.
class RSAAlgorithm(Algorithm[Any]):
@@ -70,7 +65,7 @@ class RSAAlgorithm(Algorithm[Any]):
def __init__(self, hash_alg: Union[HashAlgorithm, Prehashed]) -> None: ...
def prepare_key(self, key: Union[bytes, str, RSAPrivateKey, RSAPublicKey]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
@staticmethod
def from_jwk(jwk: Union[_LoadsString, Dict[str, Any]]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
def from_jwk(jwk: Union[str, bytes, Dict[str, Any]]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
def sign(self, msg: bytes, key: RSAPrivateKey) -> bytes: ...
def verify(self, msg: bytes, key: RSAPublicKey, sig: bytes) -> bool: ...
@@ -87,7 +82,7 @@ class ECAlgorithm(Algorithm[Any]):
@staticmethod
def to_jwk(key_obj: Union[EllipticCurvePrivateKeyWithSerialization, EllipticCurvePublicKeyWithSerialization]) -> str: ...
@staticmethod
def from_jwk(jwk: _LoadsString) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ...
def from_jwk(jwk: Union[str, bytes]) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ...
def sign(self, msg: bytes, key: EllipticCurvePrivateKey) -> bytes: ...
def verify(self, msg: bytes, key: EllipticCurvePublicKey, sig: bytes) -> bool: ...