Skip to content

Commit e8a0d1d

Browse files
authored
remove OCSPRequest abc (#11990)
1 parent 451003b commit e8a0d1d

File tree

2 files changed

+16
-46
lines changed

2 files changed

+16
-46
lines changed

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

+15-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@
22
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
33
# for complete details.
44

5-
from cryptography.hazmat.primitives import hashes
5+
from cryptography import x509
6+
from cryptography.hazmat.primitives import hashes, serialization
67
from cryptography.hazmat.primitives.asymmetric.types import PrivateKeyTypes
78
from cryptography.x509 import ocsp
89

9-
class OCSPRequest: ...
10+
class OCSPRequest:
11+
@property
12+
def issuer_key_hash(self) -> bytes: ...
13+
@property
14+
def issuer_name_hash(self) -> bytes: ...
15+
@property
16+
def hash_algorithm(self) -> hashes.HashAlgorithm: ...
17+
@property
18+
def serial_number(self) -> int: ...
19+
def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
20+
@property
21+
def extensions(self) -> x509.Extensions: ...
22+
1023
class OCSPResponse: ...
1124
class OCSPSingleResponse: ...
1225

src/cryptography/x509/ocsp.py

+1-44
Original file line numberDiff line numberDiff line change
@@ -127,49 +127,6 @@ def __init__(
127127
self._revocation_reason = revocation_reason
128128

129129

130-
class OCSPRequest(metaclass=abc.ABCMeta):
131-
@property
132-
@abc.abstractmethod
133-
def issuer_key_hash(self) -> bytes:
134-
"""
135-
The hash of the issuer public key
136-
"""
137-
138-
@property
139-
@abc.abstractmethod
140-
def issuer_name_hash(self) -> bytes:
141-
"""
142-
The hash of the issuer name
143-
"""
144-
145-
@property
146-
@abc.abstractmethod
147-
def hash_algorithm(self) -> hashes.HashAlgorithm:
148-
"""
149-
The hash algorithm used in the issuer name and key hashes
150-
"""
151-
152-
@property
153-
@abc.abstractmethod
154-
def serial_number(self) -> int:
155-
"""
156-
The serial number of the cert whose status is being checked
157-
"""
158-
159-
@abc.abstractmethod
160-
def public_bytes(self, encoding: serialization.Encoding) -> bytes:
161-
"""
162-
Serializes the request to DER
163-
"""
164-
165-
@property
166-
@abc.abstractmethod
167-
def extensions(self) -> x509.Extensions:
168-
"""
169-
The list of request extensions. Not single request extensions.
170-
"""
171-
172-
173130
class OCSPSingleResponse(metaclass=abc.ABCMeta):
174131
@property
175132
@abc.abstractmethod
@@ -460,7 +417,7 @@ def public_bytes(self, encoding: serialization.Encoding) -> bytes:
460417
"""
461418

462419

463-
OCSPRequest.register(ocsp.OCSPRequest)
420+
OCSPRequest = ocsp.OCSPRequest
464421
OCSPResponse.register(ocsp.OCSPResponse)
465422
OCSPSingleResponse.register(ocsp.OCSPSingleResponse)
466423

0 commit comments

Comments
 (0)