Skip to content

Commit 1cae81e

Browse files
authored
remove OCSPSingleResponse abc (#11993)
1 parent 6311b9d commit 1cae81e

File tree

2 files changed

+26
-96
lines changed

2 files changed

+26
-96
lines changed

src/cryptography/hazmat/bindings/_rust/ocsp.pyi

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,31 @@ class OCSPResponse:
7878
def single_extensions(self) -> x509.Extensions: ...
7979
def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
8080

81-
class OCSPSingleResponse: ...
81+
class OCSPSingleResponse:
82+
@property
83+
def certificate_status(self) -> ocsp.OCSPCertStatus: ...
84+
@property
85+
def revocation_time(self) -> datetime.datetime | None: ...
86+
@property
87+
def revocation_time_utc(self) -> datetime.datetime | None: ...
88+
@property
89+
def revocation_reason(self) -> x509.ReasonFlags | None: ...
90+
@property
91+
def this_update(self) -> datetime.datetime: ...
92+
@property
93+
def this_update_utc(self) -> datetime.datetime: ...
94+
@property
95+
def next_update(self) -> datetime.datetime | None: ...
96+
@property
97+
def next_update_utc(self) -> datetime.datetime | None: ...
98+
@property
99+
def issuer_key_hash(self) -> bytes: ...
100+
@property
101+
def issuer_name_hash(self) -> bytes: ...
102+
@property
103+
def hash_algorithm(self) -> hashes.HashAlgorithm: ...
104+
@property
105+
def serial_number(self) -> int: ...
82106

83107
def load_der_ocsp_request(data: bytes) -> ocsp.OCSPRequest: ...
84108
def load_der_ocsp_response(data: bytes) -> ocsp.OCSPResponse: ...

src/cryptography/x509/ocsp.py

Lines changed: 1 addition & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import abc
87
import datetime
98
import typing
109

@@ -127,102 +126,9 @@ def __init__(
127126
self._revocation_reason = revocation_reason
128127

129128

130-
class OCSPSingleResponse(metaclass=abc.ABCMeta):
131-
@property
132-
@abc.abstractmethod
133-
def certificate_status(self) -> OCSPCertStatus:
134-
"""
135-
The status of the certificate (an element from the OCSPCertStatus enum)
136-
"""
137-
138-
@property
139-
@abc.abstractmethod
140-
def revocation_time(self) -> datetime.datetime | None:
141-
"""
142-
The date of when the certificate was revoked or None if not
143-
revoked.
144-
"""
145-
146-
@property
147-
@abc.abstractmethod
148-
def revocation_time_utc(self) -> datetime.datetime | None:
149-
"""
150-
The date of when the certificate was revoked or None if not
151-
revoked. Represented as a non-naive UTC datetime.
152-
"""
153-
154-
@property
155-
@abc.abstractmethod
156-
def revocation_reason(self) -> x509.ReasonFlags | None:
157-
"""
158-
The reason the certificate was revoked or None if not specified or
159-
not revoked.
160-
"""
161-
162-
@property
163-
@abc.abstractmethod
164-
def this_update(self) -> datetime.datetime:
165-
"""
166-
The most recent time at which the status being indicated is known by
167-
the responder to have been correct
168-
"""
169-
170-
@property
171-
@abc.abstractmethod
172-
def this_update_utc(self) -> datetime.datetime:
173-
"""
174-
The most recent time at which the status being indicated is known by
175-
the responder to have been correct. Represented as a non-naive UTC
176-
datetime.
177-
"""
178-
179-
@property
180-
@abc.abstractmethod
181-
def next_update(self) -> datetime.datetime | None:
182-
"""
183-
The time when newer information will be available
184-
"""
185-
186-
@property
187-
@abc.abstractmethod
188-
def next_update_utc(self) -> datetime.datetime | None:
189-
"""
190-
The time when newer information will be available. Represented as a
191-
non-naive UTC datetime.
192-
"""
193-
194-
@property
195-
@abc.abstractmethod
196-
def issuer_key_hash(self) -> bytes:
197-
"""
198-
The hash of the issuer public key
199-
"""
200-
201-
@property
202-
@abc.abstractmethod
203-
def issuer_name_hash(self) -> bytes:
204-
"""
205-
The hash of the issuer name
206-
"""
207-
208-
@property
209-
@abc.abstractmethod
210-
def hash_algorithm(self) -> hashes.HashAlgorithm:
211-
"""
212-
The hash algorithm used in the issuer name and key hashes
213-
"""
214-
215-
@property
216-
@abc.abstractmethod
217-
def serial_number(self) -> int:
218-
"""
219-
The serial number of the cert whose status is being checked
220-
"""
221-
222-
223129
OCSPRequest = ocsp.OCSPRequest
224130
OCSPResponse = ocsp.OCSPResponse
225-
OCSPSingleResponse.register(ocsp.OCSPSingleResponse)
131+
OCSPSingleResponse = ocsp.OCSPSingleResponse
226132

227133

228134
class OCSPRequestBuilder:

0 commit comments

Comments
 (0)