|
12 | 12 |
|
13 | 13 | from cryptography import utils
|
14 | 14 | from cryptography.hazmat.bindings._rust import x509 as rust_x509
|
15 |
| -from cryptography.hazmat.primitives import hashes, serialization |
| 15 | +from cryptography.hazmat.primitives import hashes |
16 | 16 | from cryptography.hazmat.primitives.asymmetric import (
|
17 | 17 | dsa,
|
18 | 18 | ec,
|
@@ -232,111 +232,7 @@ def extensions(self) -> Extensions:
|
232 | 232 |
|
233 | 233 |
|
234 | 234 | CertificateRevocationList = rust_x509.CertificateRevocationList
|
235 |
| - |
236 |
| - |
237 |
| -class CertificateSigningRequest(metaclass=abc.ABCMeta): |
238 |
| - @abc.abstractmethod |
239 |
| - def __eq__(self, other: object) -> bool: |
240 |
| - """ |
241 |
| - Checks equality. |
242 |
| - """ |
243 |
| - |
244 |
| - @abc.abstractmethod |
245 |
| - def __hash__(self) -> int: |
246 |
| - """ |
247 |
| - Computes a hash. |
248 |
| - """ |
249 |
| - |
250 |
| - @abc.abstractmethod |
251 |
| - def public_key(self) -> CertificatePublicKeyTypes: |
252 |
| - """ |
253 |
| - Returns the public key |
254 |
| - """ |
255 |
| - |
256 |
| - @property |
257 |
| - @abc.abstractmethod |
258 |
| - def subject(self) -> Name: |
259 |
| - """ |
260 |
| - Returns the subject name object. |
261 |
| - """ |
262 |
| - |
263 |
| - @property |
264 |
| - @abc.abstractmethod |
265 |
| - def signature_hash_algorithm( |
266 |
| - self, |
267 |
| - ) -> hashes.HashAlgorithm | None: |
268 |
| - """ |
269 |
| - Returns a HashAlgorithm corresponding to the type of the digest signed |
270 |
| - in the certificate. |
271 |
| - """ |
272 |
| - |
273 |
| - @property |
274 |
| - @abc.abstractmethod |
275 |
| - def signature_algorithm_oid(self) -> ObjectIdentifier: |
276 |
| - """ |
277 |
| - Returns the ObjectIdentifier of the signature algorithm. |
278 |
| - """ |
279 |
| - |
280 |
| - @property |
281 |
| - @abc.abstractmethod |
282 |
| - def signature_algorithm_parameters( |
283 |
| - self, |
284 |
| - ) -> None | padding.PSS | padding.PKCS1v15 | ec.ECDSA: |
285 |
| - """ |
286 |
| - Returns the signature algorithm parameters. |
287 |
| - """ |
288 |
| - |
289 |
| - @property |
290 |
| - @abc.abstractmethod |
291 |
| - def extensions(self) -> Extensions: |
292 |
| - """ |
293 |
| - Returns the extensions in the signing request. |
294 |
| - """ |
295 |
| - |
296 |
| - @property |
297 |
| - @abc.abstractmethod |
298 |
| - def attributes(self) -> Attributes: |
299 |
| - """ |
300 |
| - Returns an Attributes object. |
301 |
| - """ |
302 |
| - |
303 |
| - @abc.abstractmethod |
304 |
| - def public_bytes(self, encoding: serialization.Encoding) -> bytes: |
305 |
| - """ |
306 |
| - Encodes the request to PEM or DER format. |
307 |
| - """ |
308 |
| - |
309 |
| - @property |
310 |
| - @abc.abstractmethod |
311 |
| - def signature(self) -> bytes: |
312 |
| - """ |
313 |
| - Returns the signature bytes. |
314 |
| - """ |
315 |
| - |
316 |
| - @property |
317 |
| - @abc.abstractmethod |
318 |
| - def tbs_certrequest_bytes(self) -> bytes: |
319 |
| - """ |
320 |
| - Returns the PKCS#10 CertificationRequestInfo bytes as defined in RFC |
321 |
| - 2986. |
322 |
| - """ |
323 |
| - |
324 |
| - @property |
325 |
| - @abc.abstractmethod |
326 |
| - def is_signature_valid(self) -> bool: |
327 |
| - """ |
328 |
| - Verifies signature of signing request. |
329 |
| - """ |
330 |
| - |
331 |
| - @abc.abstractmethod |
332 |
| - def get_attribute_for_oid(self, oid: ObjectIdentifier) -> bytes: |
333 |
| - """ |
334 |
| - Get the attribute value for a given OID. |
335 |
| - """ |
336 |
| - |
337 |
| - |
338 |
| -# Runtime isinstance checks need this since the rust class is not a subclass. |
339 |
| -CertificateSigningRequest.register(rust_x509.CertificateSigningRequest) |
| 235 | +CertificateSigningRequest = rust_x509.CertificateSigningRequest |
340 | 236 |
|
341 | 237 |
|
342 | 238 | load_pem_x509_certificate = rust_x509.load_pem_x509_certificate
|
|
0 commit comments