mrok 0.2.0__py3-none-any.whl → 0.2.1__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.
mrok/ziti/pki.py CHANGED
@@ -1,9 +1,9 @@
1
1
  import base64
2
2
 
3
+ from asn1crypto import cms
3
4
  from cryptography import x509
4
5
  from cryptography.hazmat.primitives import hashes, serialization
5
6
  from cryptography.hazmat.primitives.asymmetric import rsa
6
- from cryptography.hazmat.primitives.serialization.pkcs7 import load_der_pkcs7_certificates
7
7
  from cryptography.x509.oid import NameOID
8
8
 
9
9
  from mrok.ziti.api import ZitiManagementAPI
@@ -16,11 +16,16 @@ async def get_ca_certificates(mgmt_api: ZitiManagementAPI) -> str:
16
16
  if not _ca_certificates:
17
17
  cas_pkcs7 = await mgmt_api.fetch_ca_certificates()
18
18
  pkcs7_bytes = base64.b64decode(cas_pkcs7)
19
- pkcs7_certs = load_der_pkcs7_certificates(pkcs7_bytes)
19
+
20
+ content_info = cms.ContentInfo.load(pkcs7_bytes)
21
+ certs = content_info["content"]["certificates"]
22
+
20
23
  ca_certificates = []
21
- for cert in pkcs7_certs:
22
- cert_pem = cert.public_bytes(serialization.Encoding.PEM)
23
- ca_certificates.append(cert_pem.decode("utf-8"))
24
+ for cert in certs:
25
+ crypt_cert = x509.load_der_x509_certificate(cert.dump())
26
+ pem = crypt_cert.public_bytes(serialization.Encoding.PEM).decode("utf-8")
27
+ ca_certificates.append(pem)
28
+
24
29
  _ca_certificates = "\n".join(ca_certificates)
25
30
  return _ca_certificates
26
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mrok
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: MPT Extensions OpenZiti Orchestrator
5
5
  Author: SoftwareOne AG
6
6
  License: Apache License
@@ -206,6 +206,7 @@ License: Apache License
206
206
  limitations under the License.
207
207
  License-File: LICENSE.txt
208
208
  Requires-Python: <4,>=3.12
209
+ Requires-Dist: asn1crypto<2.0.0,>=1.5.1
209
210
  Requires-Dist: cryptography<46.0.0,>=45.0.7
210
211
  Requires-Dist: dynaconf<4.0.0,>=3.2.11
211
212
  Requires-Dist: fastapi-pagination<0.15.0,>=0.14.1
@@ -57,10 +57,10 @@ mrok/ziti/bootstrap.py,sha256=QIDhlkIxPW2QRuumFq2D1WDbD003P5f3z24pAUsyeBI,2696
57
57
  mrok/ziti/constants.py,sha256=Urq1X3bCBQZfw8NbnEa1pqmY4oq1wmzkwPfzam3kbTw,339
58
58
  mrok/ziti/errors.py,sha256=yYCbVDwktnR0AYduqtynIjo73K3HOhIrwA_vQimvEd4,368
59
59
  mrok/ziti/identities.py,sha256=oE_3j6Y4xCr6uKNdprW55bxGsyKnmJt-MrxrylB2Ey4,5388
60
- mrok/ziti/pki.py,sha256=-V3LDAtntYZ4C6IH2rqfAANxmzpOZ32Rd0MK_27YNME,1906
60
+ mrok/ziti/pki.py,sha256=o2tySqHC8-7bvFuI2Tqxg9vX6H6ZSxWxfP_9x29e19M,1954
61
61
  mrok/ziti/services.py,sha256=JnznLTHNZjgbFwnBtv7y2XIp4NiQxLVawwP9EfWdVuM,3208
62
- mrok-0.2.0.dist-info/METADATA,sha256=A2vtrbNcUnIOTYf0xU2KZubFzN_yA7wShKQuMZcnKaE,15506
63
- mrok-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
64
- mrok-0.2.0.dist-info/entry_points.txt,sha256=tloXwvU1uJicBJR2h-8HoVclPgwJWDwuREMHN8Zq-nU,38
65
- mrok-0.2.0.dist-info/licenses/LICENSE.txt,sha256=6PaICaoA3yNsZKLv5G6OKqSfLSoX7MakYqTDgJoTCBs,11346
66
- mrok-0.2.0.dist-info/RECORD,,
62
+ mrok-0.2.1.dist-info/METADATA,sha256=6pEGhIuJ0KJNyG3QXfLouC71PaFpywYGg2AEWrrQFLg,15546
63
+ mrok-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
64
+ mrok-0.2.1.dist-info/entry_points.txt,sha256=tloXwvU1uJicBJR2h-8HoVclPgwJWDwuREMHN8Zq-nU,38
65
+ mrok-0.2.1.dist-info/licenses/LICENSE.txt,sha256=6PaICaoA3yNsZKLv5G6OKqSfLSoX7MakYqTDgJoTCBs,11346
66
+ mrok-0.2.1.dist-info/RECORD,,
File without changes