diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2021-12-21 20:56:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-22 01:56:11 +0000 |
| commit | 2b22cf0fec249419f35d98be0377673dd1aaa0a4 (patch) | |
| tree | 3207a5243e37e3fb26714f83cb9e1109b2f03547 /src/cryptography/x509 | |
| parent | 14673eef03d3138f0bf06c4b47073ee647fbd6a7 (diff) | |
| download | cryptography-2b22cf0fec249419f35d98be0377673dd1aaa0a4.tar.gz | |
Improve typing of ocsp module (#6721)
Diffstat (limited to 'src/cryptography/x509')
| -rw-r--r-- | src/cryptography/x509/ocsp.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cryptography/x509/ocsp.py b/src/cryptography/x509/ocsp.py index 8eec4c0c6..fd893a558 100644 --- a/src/cryptography/x509/ocsp.py +++ b/src/cryptography/x509/ocsp.py @@ -42,7 +42,7 @@ _ALLOWED_HASHES = ( ) -def _verify_algorithm(algorithm): +def _verify_algorithm(algorithm: hashes.HashAlgorithm) -> None: if not isinstance(algorithm, _ALLOWED_HASHES): raise ValueError( "Algorithm must be SHA1, SHA224, SHA256, SHA384, or SHA512" @@ -58,14 +58,14 @@ class OCSPCertStatus(utils.Enum): class _SingleResponse(object): def __init__( self, - cert, - issuer, - algorithm, - cert_status, - this_update, - next_update, - revocation_time, - revocation_reason, + cert: x509.Certificate, + issuer: x509.Certificate, + algorithm: hashes.HashAlgorithm, + cert_status: OCSPCertStatus, + this_update: datetime.datetime, + next_update: typing.Optional[datetime.datetime], + revocation_time: typing.Optional[datetime.datetime], + revocation_reason: typing.Optional[x509.ReasonFlags], ): if not isinstance(cert, x509.Certificate) or not isinstance( issuer, x509.Certificate |
