Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove OCSPRequest abc #11990

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/cryptography/hazmat/bindings/_rust/ocsp.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.

from cryptography.hazmat.primitives import hashes
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric.types import PrivateKeyTypes
from cryptography.x509 import ocsp

class OCSPRequest: ...
class OCSPRequest:
@property
def issuer_key_hash(self) -> bytes: ...
@property
def issuer_name_hash(self) -> bytes: ...
@property
def hash_algorithm(self) -> hashes.HashAlgorithm: ...
@property
def serial_number(self) -> int: ...
def public_bytes(self, encoding: serialization.Encoding) -> bytes: ...
@property
def extensions(self) -> x509.Extensions: ...

class OCSPResponse: ...
class OCSPSingleResponse: ...

Expand Down
45 changes: 1 addition & 44 deletions src/cryptography/x509/ocsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,49 +127,6 @@ def __init__(
self._revocation_reason = revocation_reason


class OCSPRequest(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
def issuer_key_hash(self) -> bytes:
"""
The hash of the issuer public key
"""

@property
@abc.abstractmethod
def issuer_name_hash(self) -> bytes:
"""
The hash of the issuer name
"""

@property
@abc.abstractmethod
def hash_algorithm(self) -> hashes.HashAlgorithm:
"""
The hash algorithm used in the issuer name and key hashes
"""

@property
@abc.abstractmethod
def serial_number(self) -> int:
"""
The serial number of the cert whose status is being checked
"""

@abc.abstractmethod
def public_bytes(self, encoding: serialization.Encoding) -> bytes:
"""
Serializes the request to DER
"""

@property
@abc.abstractmethod
def extensions(self) -> x509.Extensions:
"""
The list of request extensions. Not single request extensions.
"""


class OCSPSingleResponse(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
Expand Down Expand Up @@ -460,7 +417,7 @@ def public_bytes(self, encoding: serialization.Encoding) -> bytes:
"""


OCSPRequest.register(ocsp.OCSPRequest)
OCSPRequest = ocsp.OCSPRequest
OCSPResponse.register(ocsp.OCSPResponse)
OCSPSingleResponse.register(ocsp.OCSPSingleResponse)

Expand Down