py2docfx 0.1.9.dev1927679__py3-none-any.whl → 0.1.9.dev1929293__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. py2docfx/__main__.py +18 -2
  2. py2docfx/convert_prepare/git.py +8 -5
  3. py2docfx/docfx_yaml/logger.py +13 -0
  4. py2docfx/venv/venv1/Lib/site-packages/cryptography/__about__.py +1 -1
  5. py2docfx/venv/venv1/Lib/site-packages/cryptography/__init__.py +13 -0
  6. py2docfx/venv/venv1/Lib/site-packages/cryptography/fernet.py +8 -0
  7. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/_oid.py +2 -0
  8. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/backends/openssl/backend.py +8 -14
  9. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +10 -7
  10. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +12 -6
  11. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/argon2.py +13 -0
  12. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/scrypt.py +3 -64
  13. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/padding.py +3 -24
  14. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/pkcs7.py +33 -0
  15. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/hotp.py +9 -1
  16. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/twofactor/totp.py +5 -0
  17. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/__init__.py +8 -0
  18. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/base.py +4 -415
  19. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/certificate_transparency.py +1 -63
  20. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/extensions.py +286 -5
  21. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/ocsp.py +4 -338
  22. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/__init__.py +1 -1
  23. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any.py +39 -0
  24. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any_pb2.py +3 -3
  25. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/api_pb2.py +3 -3
  26. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/compiler/plugin_pb2.py +3 -3
  27. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pb2.py +108 -108
  28. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration.py +100 -0
  29. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration_pb2.py +3 -3
  30. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/empty_pb2.py +3 -3
  31. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/field_mask_pb2.py +3 -3
  32. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_message.py +7 -4
  33. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/well_known_types.py +1 -1
  34. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/pyext/cpp_message.py +1 -1
  35. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/runtime_version.py +16 -9
  36. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/service.py +4 -4
  37. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/source_context_pb2.py +3 -3
  38. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/struct_pb2.py +3 -3
  39. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/text_format.py +1 -1
  40. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp.py +112 -0
  41. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp_pb2.py +3 -3
  42. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/type_pb2.py +3 -3
  43. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/wrappers_pb2.py +3 -3
  44. py2docfx/venv/venv1/Lib/site-packages/jwt/__init__.py +1 -1
  45. py2docfx/venv/venv1/Lib/site-packages/jwt/api_jwt.py +3 -3
  46. {py2docfx-0.1.9.dev1927679.dist-info → py2docfx-0.1.9.dev1929293.dist-info}/METADATA +1 -1
  47. {py2docfx-0.1.9.dev1927679.dist-info → py2docfx-0.1.9.dev1929293.dist-info}/RECORD +49 -45
  48. {py2docfx-0.1.9.dev1927679.dist-info → py2docfx-0.1.9.dev1929293.dist-info}/WHEEL +0 -0
  49. {py2docfx-0.1.9.dev1927679.dist-info → py2docfx-0.1.9.dev1929293.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,7 @@ import warnings
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,
@@ -25,7 +25,6 @@ from cryptography.hazmat.primitives.asymmetric import (
25
25
  )
26
26
  from cryptography.hazmat.primitives.asymmetric.types import (
27
27
  CertificateIssuerPrivateKeyTypes,
28
- CertificateIssuerPublicKeyTypes,
29
28
  CertificatePublicKeyTypes,
30
29
  )
31
30
  from cryptography.x509.extensions import (
@@ -160,166 +159,7 @@ class InvalidVersion(Exception):
160
159
  self.parsed_version = parsed_version
161
160
 
162
161
 
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)
162
+ Certificate = rust_x509.Certificate
323
163
 
324
164
 
325
165
  class RevokedCertificate(metaclass=abc.ABCMeta):
@@ -391,259 +231,8 @@ class _RawRevokedCertificate(RevokedCertificate):
391
231
  return self._extensions
392
232
 
393
233
 
394
- class CertificateRevocationList(metaclass=abc.ABCMeta):
395
- @abc.abstractmethod
396
- def public_bytes(self, encoding: serialization.Encoding) -> bytes:
397
- """
398
- Serializes the CRL to PEM or DER format.
399
- """
400
-
401
- @abc.abstractmethod
402
- def fingerprint(self, algorithm: hashes.HashAlgorithm) -> bytes:
403
- """
404
- Returns bytes using digest passed.
405
- """
406
-
407
- @abc.abstractmethod
408
- def get_revoked_certificate_by_serial_number(
409
- self, serial_number: int
410
- ) -> RevokedCertificate | None:
411
- """
412
- Returns an instance of RevokedCertificate or None if the serial_number
413
- is not in the CRL.
414
- """
415
-
416
- @property
417
- @abc.abstractmethod
418
- def signature_hash_algorithm(
419
- self,
420
- ) -> hashes.HashAlgorithm | None:
421
- """
422
- Returns a HashAlgorithm corresponding to the type of the digest signed
423
- in the certificate.
424
- """
425
-
426
- @property
427
- @abc.abstractmethod
428
- def signature_algorithm_oid(self) -> ObjectIdentifier:
429
- """
430
- Returns the ObjectIdentifier of the signature algorithm.
431
- """
432
-
433
- @property
434
- @abc.abstractmethod
435
- def signature_algorithm_parameters(
436
- self,
437
- ) -> None | padding.PSS | padding.PKCS1v15 | ec.ECDSA:
438
- """
439
- Returns the signature algorithm parameters.
440
- """
441
-
442
- @property
443
- @abc.abstractmethod
444
- def issuer(self) -> Name:
445
- """
446
- Returns the X509Name with the issuer of this CRL.
447
- """
448
-
449
- @property
450
- @abc.abstractmethod
451
- def next_update(self) -> datetime.datetime | None:
452
- """
453
- Returns the date of next update for this CRL.
454
- """
455
-
456
- @property
457
- @abc.abstractmethod
458
- def next_update_utc(self) -> datetime.datetime | None:
459
- """
460
- Returns the date of next update for this CRL as a non-naive UTC
461
- datetime.
462
- """
463
-
464
- @property
465
- @abc.abstractmethod
466
- def last_update(self) -> datetime.datetime:
467
- """
468
- Returns the date of last update for this CRL.
469
- """
470
-
471
- @property
472
- @abc.abstractmethod
473
- def last_update_utc(self) -> datetime.datetime:
474
- """
475
- Returns the date of last update for this CRL as a non-naive UTC
476
- datetime.
477
- """
478
-
479
- @property
480
- @abc.abstractmethod
481
- def extensions(self) -> Extensions:
482
- """
483
- Returns an Extensions object containing a list of CRL extensions.
484
- """
485
-
486
- @property
487
- @abc.abstractmethod
488
- def signature(self) -> bytes:
489
- """
490
- Returns the signature bytes.
491
- """
492
-
493
- @property
494
- @abc.abstractmethod
495
- def tbs_certlist_bytes(self) -> bytes:
496
- """
497
- Returns the tbsCertList payload bytes as defined in RFC 5280.
498
- """
499
-
500
- @abc.abstractmethod
501
- def __eq__(self, other: object) -> bool:
502
- """
503
- Checks equality.
504
- """
505
-
506
- @abc.abstractmethod
507
- def __len__(self) -> int:
508
- """
509
- Number of revoked certificates in the CRL.
510
- """
511
-
512
- @typing.overload
513
- def __getitem__(self, idx: int) -> RevokedCertificate: ...
514
-
515
- @typing.overload
516
- def __getitem__(self, idx: slice) -> list[RevokedCertificate]: ...
517
-
518
- @abc.abstractmethod
519
- def __getitem__(
520
- self, idx: int | slice
521
- ) -> RevokedCertificate | list[RevokedCertificate]:
522
- """
523
- Returns a revoked certificate (or slice of revoked certificates).
524
- """
525
-
526
- @abc.abstractmethod
527
- def __iter__(self) -> typing.Iterator[RevokedCertificate]:
528
- """
529
- Iterator over the revoked certificates
530
- """
531
-
532
- @abc.abstractmethod
533
- def is_signature_valid(
534
- self, public_key: CertificateIssuerPublicKeyTypes
535
- ) -> bool:
536
- """
537
- Verifies signature of revocation list against given public key.
538
- """
539
-
540
-
541
- CertificateRevocationList.register(rust_x509.CertificateRevocationList)
542
-
543
-
544
- class CertificateSigningRequest(metaclass=abc.ABCMeta):
545
- @abc.abstractmethod
546
- def __eq__(self, other: object) -> bool:
547
- """
548
- Checks equality.
549
- """
550
-
551
- @abc.abstractmethod
552
- def __hash__(self) -> int:
553
- """
554
- Computes a hash.
555
- """
556
-
557
- @abc.abstractmethod
558
- def public_key(self) -> CertificatePublicKeyTypes:
559
- """
560
- Returns the public key
561
- """
562
-
563
- @property
564
- @abc.abstractmethod
565
- def subject(self) -> Name:
566
- """
567
- Returns the subject name object.
568
- """
569
-
570
- @property
571
- @abc.abstractmethod
572
- def signature_hash_algorithm(
573
- self,
574
- ) -> hashes.HashAlgorithm | None:
575
- """
576
- Returns a HashAlgorithm corresponding to the type of the digest signed
577
- in the certificate.
578
- """
579
-
580
- @property
581
- @abc.abstractmethod
582
- def signature_algorithm_oid(self) -> ObjectIdentifier:
583
- """
584
- Returns the ObjectIdentifier of the signature algorithm.
585
- """
586
-
587
- @property
588
- @abc.abstractmethod
589
- def signature_algorithm_parameters(
590
- self,
591
- ) -> None | padding.PSS | padding.PKCS1v15 | ec.ECDSA:
592
- """
593
- Returns the signature algorithm parameters.
594
- """
595
-
596
- @property
597
- @abc.abstractmethod
598
- def extensions(self) -> Extensions:
599
- """
600
- Returns the extensions in the signing request.
601
- """
602
-
603
- @property
604
- @abc.abstractmethod
605
- def attributes(self) -> Attributes:
606
- """
607
- Returns an Attributes object.
608
- """
609
-
610
- @abc.abstractmethod
611
- def public_bytes(self, encoding: serialization.Encoding) -> bytes:
612
- """
613
- Encodes the request to PEM or DER format.
614
- """
615
-
616
- @property
617
- @abc.abstractmethod
618
- def signature(self) -> bytes:
619
- """
620
- Returns the signature bytes.
621
- """
622
-
623
- @property
624
- @abc.abstractmethod
625
- def tbs_certrequest_bytes(self) -> bytes:
626
- """
627
- Returns the PKCS#10 CertificationRequestInfo bytes as defined in RFC
628
- 2986.
629
- """
630
-
631
- @property
632
- @abc.abstractmethod
633
- def is_signature_valid(self) -> bool:
634
- """
635
- Verifies signature of signing request.
636
- """
637
-
638
- @abc.abstractmethod
639
- def get_attribute_for_oid(self, oid: ObjectIdentifier) -> bytes:
640
- """
641
- Get the attribute value for a given OID.
642
- """
643
-
644
-
645
- # Runtime isinstance checks need this since the rust class is not a subclass.
646
- CertificateSigningRequest.register(rust_x509.CertificateSigningRequest)
234
+ CertificateRevocationList = rust_x509.CertificateRevocationList
235
+ CertificateSigningRequest = rust_x509.CertificateSigningRequest
647
236
 
648
237
 
649
238
  load_pem_x509_certificate = rust_x509.load_pem_x509_certificate
@@ -4,12 +4,8 @@
4
4
 
5
5
  from __future__ import annotations
6
6
 
7
- import abc
8
- import datetime
9
-
10
7
  from cryptography import utils
11
8
  from cryptography.hazmat.bindings._rust import x509 as rust_x509
12
- from cryptography.hazmat.primitives.hashes import HashAlgorithm
13
9
 
14
10
 
15
11
  class LogEntryType(utils.Enum):
@@ -36,62 +32,4 @@ class SignatureAlgorithm(utils.Enum):
36
32
  ECDSA = 3
37
33
 
38
34
 
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