__init__.pyi: Accept RSAPrivateKey or RSAPublicKey as the key (#3410)

Closes: #3381
This commit is contained in:
Utkarsh Gupta
2019-10-27 00:39:06 +05:30
committed by Sebastian Rittau
parent 124111534a
commit 72ff7b94e5

View File

@@ -1,13 +1,15 @@
from typing import Mapping, Any, Optional, Union, Dict
from . import algorithms
from cryptography.hazmat.primitives.asymmetric import rsa
def decode(jwt: Union[str, bytes], key: Union[str, bytes] = ...,
def decode(jwt: Union[str, bytes], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey] = ...,
verify: bool = ..., algorithms: Optional[Any] = ...,
options: Optional[Mapping[Any, Any]] = ...,
**kwargs: Any) -> Dict[str, Any]: ...
def encode(payload: Mapping[str, Any], key: Union[str, bytes],
def encode(payload: Mapping[str, Any], key: Union[str, bytes, rsa.RSAPublicKey, rsa.RSAPrivateKey],
algorithm: str = ..., headers: Optional[Mapping[str, Any]] = ...,
json_encoder: Optional[Any] = ...) -> bytes: ...