@@ -160,166 +160,7 @@ def __init__(self, msg: str, parsed_version: int) -> None:
160
160
self .parsed_version = parsed_version
161
161
162
162
163
- class Certificate (metaclass = abc .ABCMeta ):
164
- @abc .abstractmethod
165
- def fingerprint (self , algorithm : hashes .HashAlgorithm ) -> bytes :
166
- """
167
- Returns bytes using digest passed.
168
- """
169
-
170
- @property
171
- @abc .abstractmethod
172
- def serial_number (self ) -> int :
173
- """
174
- Returns certificate serial number
175
- """
176
-
177
- @property
178
- @abc .abstractmethod
179
- def version (self ) -> Version :
180
- """
181
- Returns the certificate version
182
- """
183
-
184
- @abc .abstractmethod
185
- def public_key (self ) -> CertificatePublicKeyTypes :
186
- """
187
- Returns the public key
188
- """
189
-
190
- @property
191
- @abc .abstractmethod
192
- def public_key_algorithm_oid (self ) -> ObjectIdentifier :
193
- """
194
- Returns the ObjectIdentifier of the public key.
195
- """
196
-
197
- @property
198
- @abc .abstractmethod
199
- def not_valid_before (self ) -> datetime .datetime :
200
- """
201
- Not before time (represented as UTC datetime)
202
- """
203
-
204
- @property
205
- @abc .abstractmethod
206
- def not_valid_before_utc (self ) -> datetime .datetime :
207
- """
208
- Not before time (represented as a non-naive UTC datetime)
209
- """
210
-
211
- @property
212
- @abc .abstractmethod
213
- def not_valid_after (self ) -> datetime .datetime :
214
- """
215
- Not after time (represented as UTC datetime)
216
- """
217
-
218
- @property
219
- @abc .abstractmethod
220
- def not_valid_after_utc (self ) -> datetime .datetime :
221
- """
222
- Not after time (represented as a non-naive UTC datetime)
223
- """
224
-
225
- @property
226
- @abc .abstractmethod
227
- def issuer (self ) -> Name :
228
- """
229
- Returns the issuer name object.
230
- """
231
-
232
- @property
233
- @abc .abstractmethod
234
- def subject (self ) -> Name :
235
- """
236
- Returns the subject name object.
237
- """
238
-
239
- @property
240
- @abc .abstractmethod
241
- def signature_hash_algorithm (
242
- self ,
243
- ) -> hashes .HashAlgorithm | None :
244
- """
245
- Returns a HashAlgorithm corresponding to the type of the digest signed
246
- in the certificate.
247
- """
248
-
249
- @property
250
- @abc .abstractmethod
251
- def signature_algorithm_oid (self ) -> ObjectIdentifier :
252
- """
253
- Returns the ObjectIdentifier of the signature algorithm.
254
- """
255
-
256
- @property
257
- @abc .abstractmethod
258
- def signature_algorithm_parameters (
259
- self ,
260
- ) -> None | padding .PSS | padding .PKCS1v15 | ec .ECDSA :
261
- """
262
- Returns the signature algorithm parameters.
263
- """
264
-
265
- @property
266
- @abc .abstractmethod
267
- def extensions (self ) -> Extensions :
268
- """
269
- Returns an Extensions object.
270
- """
271
-
272
- @property
273
- @abc .abstractmethod
274
- def signature (self ) -> bytes :
275
- """
276
- Returns the signature bytes.
277
- """
278
-
279
- @property
280
- @abc .abstractmethod
281
- def tbs_certificate_bytes (self ) -> bytes :
282
- """
283
- Returns the tbsCertificate payload bytes as defined in RFC 5280.
284
- """
285
-
286
- @property
287
- @abc .abstractmethod
288
- def tbs_precertificate_bytes (self ) -> bytes :
289
- """
290
- Returns the tbsCertificate payload bytes with the SCT list extension
291
- stripped.
292
- """
293
-
294
- @abc .abstractmethod
295
- def __eq__ (self , other : object ) -> bool :
296
- """
297
- Checks equality.
298
- """
299
-
300
- @abc .abstractmethod
301
- def __hash__ (self ) -> int :
302
- """
303
- Computes a hash.
304
- """
305
-
306
- @abc .abstractmethod
307
- def public_bytes (self , encoding : serialization .Encoding ) -> bytes :
308
- """
309
- Serializes the certificate to PEM or DER format.
310
- """
311
-
312
- @abc .abstractmethod
313
- def verify_directly_issued_by (self , issuer : Certificate ) -> None :
314
- """
315
- This method verifies that certificate issuer name matches the
316
- issuer subject name and that the certificate is signed by the
317
- issuer's private key. No other validation is performed.
318
- """
319
-
320
-
321
- # Runtime isinstance checks need this since the rust class is not a subclass.
322
- Certificate .register (rust_x509 .Certificate )
163
+ Certificate = rust_x509 .Certificate
323
164
324
165
325
166
class RevokedCertificate (metaclass = abc .ABCMeta ):
0 commit comments