Skip to content

Commit 4c72f36

Browse files
authored
remove sct abc (#11995)
* remove sct abc * don't alias
1 parent 3fdf1f8 commit 4c72f36

File tree

2 files changed

+21
-64
lines changed

2 files changed

+21
-64
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ from cryptography.hazmat.primitives.asymmetric.types import (
1414
CertificatePublicKeyTypes,
1515
PrivateKeyTypes,
1616
)
17+
from cryptography.x509 import certificate_transparency
1718

1819
def load_pem_x509_certificate(
1920
data: bytes, backend: typing.Any = None
@@ -57,7 +58,25 @@ def create_x509_crl(
5758
rsa_padding: PKCS1v15 | PSS | None,
5859
) -> x509.CertificateRevocationList: ...
5960

60-
class Sct: ...
61+
class Sct:
62+
@property
63+
def version(self) -> certificate_transparency.Version: ...
64+
@property
65+
def log_id(self) -> bytes: ...
66+
@property
67+
def timestamp(self) -> datetime.datetime: ...
68+
@property
69+
def entry_type(self) -> certificate_transparency.LogEntryType: ...
70+
@property
71+
def signature_hash_algorithm(self) -> hashes.HashAlgorithm: ...
72+
@property
73+
def signature_algorithm(
74+
self,
75+
) -> certificate_transparency.SignatureAlgorithm: ...
76+
@property
77+
def signature(self) -> bytes: ...
78+
@property
79+
def extension_bytes(self) -> bytes: ...
6180

6281
class Certificate:
6382
def fingerprint(self, algorithm: hashes.HashAlgorithm) -> bytes: ...

src/cryptography/x509/certificate_transparency.py

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@
44

55
from __future__ import annotations
66

7-
import abc
8-
import datetime
9-
107
from cryptography import utils
118
from cryptography.hazmat.bindings._rust import x509 as rust_x509
12-
from cryptography.hazmat.primitives.hashes import HashAlgorithm
139

1410

1511
class LogEntryType(utils.Enum):
@@ -36,62 +32,4 @@ class SignatureAlgorithm(utils.Enum):
3632
ECDSA = 3
3733

3834

39-
class SignedCertificateTimestamp(metaclass=abc.ABCMeta):
40-
@property
41-
@abc.abstractmethod
42-
def version(self) -> Version:
43-
"""
44-
Returns the SCT version.
45-
"""
46-
47-
@property
48-
@abc.abstractmethod
49-
def log_id(self) -> bytes:
50-
"""
51-
Returns an identifier indicating which log this SCT is for.
52-
"""
53-
54-
@property
55-
@abc.abstractmethod
56-
def timestamp(self) -> datetime.datetime:
57-
"""
58-
Returns the timestamp for this SCT.
59-
"""
60-
61-
@property
62-
@abc.abstractmethod
63-
def entry_type(self) -> LogEntryType:
64-
"""
65-
Returns whether this is an SCT for a certificate or pre-certificate.
66-
"""
67-
68-
@property
69-
@abc.abstractmethod
70-
def signature_hash_algorithm(self) -> HashAlgorithm:
71-
"""
72-
Returns the hash algorithm used for the SCT's signature.
73-
"""
74-
75-
@property
76-
@abc.abstractmethod
77-
def signature_algorithm(self) -> SignatureAlgorithm:
78-
"""
79-
Returns the signing algorithm used for the SCT's signature.
80-
"""
81-
82-
@property
83-
@abc.abstractmethod
84-
def signature(self) -> bytes:
85-
"""
86-
Returns the signature for this SCT.
87-
"""
88-
89-
@property
90-
@abc.abstractmethod
91-
def extension_bytes(self) -> bytes:
92-
"""
93-
Returns the raw bytes of any extensions for this SCT.
94-
"""
95-
96-
97-
SignedCertificateTimestamp.register(rust_x509.Sct)
35+
SignedCertificateTimestamp = rust_x509.Sct

0 commit comments

Comments
 (0)