|
10 | 10 |
|
11 | 11 | from cryptography import utils, x509
|
12 | 12 | from cryptography.hazmat.bindings._rust import ocsp
|
13 |
| -from cryptography.hazmat.primitives import hashes, serialization |
| 13 | +from cryptography.hazmat.primitives import hashes |
14 | 14 | from cryptography.hazmat.primitives.asymmetric.types import (
|
15 | 15 | CertificateIssuerPrivateKeyTypes,
|
16 | 16 | )
|
@@ -220,205 +220,8 @@ def serial_number(self) -> int:
|
220 | 220 | """
|
221 | 221 |
|
222 | 222 |
|
223 |
| -class OCSPResponse(metaclass=abc.ABCMeta): |
224 |
| - @property |
225 |
| - @abc.abstractmethod |
226 |
| - def responses(self) -> typing.Iterator[OCSPSingleResponse]: |
227 |
| - """ |
228 |
| - An iterator over the individual SINGLERESP structures in the |
229 |
| - response |
230 |
| - """ |
231 |
| - |
232 |
| - @property |
233 |
| - @abc.abstractmethod |
234 |
| - def response_status(self) -> OCSPResponseStatus: |
235 |
| - """ |
236 |
| - The status of the response. This is a value from the OCSPResponseStatus |
237 |
| - enumeration |
238 |
| - """ |
239 |
| - |
240 |
| - @property |
241 |
| - @abc.abstractmethod |
242 |
| - def signature_algorithm_oid(self) -> x509.ObjectIdentifier: |
243 |
| - """ |
244 |
| - The ObjectIdentifier of the signature algorithm |
245 |
| - """ |
246 |
| - |
247 |
| - @property |
248 |
| - @abc.abstractmethod |
249 |
| - def signature_hash_algorithm( |
250 |
| - self, |
251 |
| - ) -> hashes.HashAlgorithm | None: |
252 |
| - """ |
253 |
| - Returns a HashAlgorithm corresponding to the type of the digest signed |
254 |
| - """ |
255 |
| - |
256 |
| - @property |
257 |
| - @abc.abstractmethod |
258 |
| - def signature(self) -> bytes: |
259 |
| - """ |
260 |
| - The signature bytes |
261 |
| - """ |
262 |
| - |
263 |
| - @property |
264 |
| - @abc.abstractmethod |
265 |
| - def tbs_response_bytes(self) -> bytes: |
266 |
| - """ |
267 |
| - The tbsResponseData bytes |
268 |
| - """ |
269 |
| - |
270 |
| - @property |
271 |
| - @abc.abstractmethod |
272 |
| - def certificates(self) -> list[x509.Certificate]: |
273 |
| - """ |
274 |
| - A list of certificates used to help build a chain to verify the OCSP |
275 |
| - response. This situation occurs when the OCSP responder uses a delegate |
276 |
| - certificate. |
277 |
| - """ |
278 |
| - |
279 |
| - @property |
280 |
| - @abc.abstractmethod |
281 |
| - def responder_key_hash(self) -> bytes | None: |
282 |
| - """ |
283 |
| - The responder's key hash or None |
284 |
| - """ |
285 |
| - |
286 |
| - @property |
287 |
| - @abc.abstractmethod |
288 |
| - def responder_name(self) -> x509.Name | None: |
289 |
| - """ |
290 |
| - The responder's Name or None |
291 |
| - """ |
292 |
| - |
293 |
| - @property |
294 |
| - @abc.abstractmethod |
295 |
| - def produced_at(self) -> datetime.datetime: |
296 |
| - """ |
297 |
| - The time the response was produced |
298 |
| - """ |
299 |
| - |
300 |
| - @property |
301 |
| - @abc.abstractmethod |
302 |
| - def produced_at_utc(self) -> datetime.datetime: |
303 |
| - """ |
304 |
| - The time the response was produced. Represented as a non-naive UTC |
305 |
| - datetime. |
306 |
| - """ |
307 |
| - |
308 |
| - @property |
309 |
| - @abc.abstractmethod |
310 |
| - def certificate_status(self) -> OCSPCertStatus: |
311 |
| - """ |
312 |
| - The status of the certificate (an element from the OCSPCertStatus enum) |
313 |
| - """ |
314 |
| - |
315 |
| - @property |
316 |
| - @abc.abstractmethod |
317 |
| - def revocation_time(self) -> datetime.datetime | None: |
318 |
| - """ |
319 |
| - The date of when the certificate was revoked or None if not |
320 |
| - revoked. |
321 |
| - """ |
322 |
| - |
323 |
| - @property |
324 |
| - @abc.abstractmethod |
325 |
| - def revocation_time_utc(self) -> datetime.datetime | None: |
326 |
| - """ |
327 |
| - The date of when the certificate was revoked or None if not |
328 |
| - revoked. Represented as a non-naive UTC datetime. |
329 |
| - """ |
330 |
| - |
331 |
| - @property |
332 |
| - @abc.abstractmethod |
333 |
| - def revocation_reason(self) -> x509.ReasonFlags | None: |
334 |
| - """ |
335 |
| - The reason the certificate was revoked or None if not specified or |
336 |
| - not revoked. |
337 |
| - """ |
338 |
| - |
339 |
| - @property |
340 |
| - @abc.abstractmethod |
341 |
| - def this_update(self) -> datetime.datetime: |
342 |
| - """ |
343 |
| - The most recent time at which the status being indicated is known by |
344 |
| - the responder to have been correct |
345 |
| - """ |
346 |
| - |
347 |
| - @property |
348 |
| - @abc.abstractmethod |
349 |
| - def this_update_utc(self) -> datetime.datetime: |
350 |
| - """ |
351 |
| - The most recent time at which the status being indicated is known by |
352 |
| - the responder to have been correct. Represented as a non-naive UTC |
353 |
| - datetime. |
354 |
| - """ |
355 |
| - |
356 |
| - @property |
357 |
| - @abc.abstractmethod |
358 |
| - def next_update(self) -> datetime.datetime | None: |
359 |
| - """ |
360 |
| - The time when newer information will be available |
361 |
| - """ |
362 |
| - |
363 |
| - @property |
364 |
| - @abc.abstractmethod |
365 |
| - def next_update_utc(self) -> datetime.datetime | None: |
366 |
| - """ |
367 |
| - The time when newer information will be available. Represented as a |
368 |
| - non-naive UTC datetime. |
369 |
| - """ |
370 |
| - |
371 |
| - @property |
372 |
| - @abc.abstractmethod |
373 |
| - def issuer_key_hash(self) -> bytes: |
374 |
| - """ |
375 |
| - The hash of the issuer public key |
376 |
| - """ |
377 |
| - |
378 |
| - @property |
379 |
| - @abc.abstractmethod |
380 |
| - def issuer_name_hash(self) -> bytes: |
381 |
| - """ |
382 |
| - The hash of the issuer name |
383 |
| - """ |
384 |
| - |
385 |
| - @property |
386 |
| - @abc.abstractmethod |
387 |
| - def hash_algorithm(self) -> hashes.HashAlgorithm: |
388 |
| - """ |
389 |
| - The hash algorithm used in the issuer name and key hashes |
390 |
| - """ |
391 |
| - |
392 |
| - @property |
393 |
| - @abc.abstractmethod |
394 |
| - def serial_number(self) -> int: |
395 |
| - """ |
396 |
| - The serial number of the cert whose status is being checked |
397 |
| - """ |
398 |
| - |
399 |
| - @property |
400 |
| - @abc.abstractmethod |
401 |
| - def extensions(self) -> x509.Extensions: |
402 |
| - """ |
403 |
| - The list of response extensions. Not single response extensions. |
404 |
| - """ |
405 |
| - |
406 |
| - @property |
407 |
| - @abc.abstractmethod |
408 |
| - def single_extensions(self) -> x509.Extensions: |
409 |
| - """ |
410 |
| - The list of single response extensions. Not response extensions. |
411 |
| - """ |
412 |
| - |
413 |
| - @abc.abstractmethod |
414 |
| - def public_bytes(self, encoding: serialization.Encoding) -> bytes: |
415 |
| - """ |
416 |
| - Serializes the response to DER |
417 |
| - """ |
418 |
| - |
419 |
| - |
420 | 223 | OCSPRequest = ocsp.OCSPRequest
|
421 |
| -OCSPResponse.register(ocsp.OCSPResponse) |
| 224 | +OCSPResponse = ocsp.OCSPResponse |
422 | 225 | OCSPSingleResponse.register(ocsp.OCSPSingleResponse)
|
423 | 226 |
|
424 | 227 |
|
|
0 commit comments