Skip to content

Commit

Permalink
Updated the Test-Net PAAs and added Main-Net PAAs (#23345)
Browse files Browse the repository at this point in the history
  • Loading branch information
vijs authored and pull[bot] committed Feb 22, 2024
1 parent f991b2e commit 9829444
Show file tree
Hide file tree
Showing 35 changed files with 229 additions and 13 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuzCCAWCgAwIBAgIRAOB6fBhIhEjMAxZB+BY/ZAYwCgYIKoZIzj0EAwIwLDEU
MBIGA1UEAwwLQUIgVGVzdCBQQUExFDASBgorBgEEAYKifAIBDAQxMzdCMB4XDTIy
MTAxMjAxMzExMVoXDTIzMTAxMjAyMzExMVowLDEUMBIGA1UEAwwLQUIgVGVzdCBQ
QUExFDASBgorBgEEAYKifAIBDAQxMzdCMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD
QgAETYJwXDYMXi1jXAfSWxU4j1esZdh0N8K62vAEKaQ6DBEN1YPyFSaP4PLSgGZX
qk35G5SrFz/mqR/dbglpFaNbxaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
FgQUzfLv60FwRw2mmGqbQBlhNzbBKzwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQY
MBaAFM3y7+tBcEcNpphqm0AZYTc2wSs8MAoGCCqGSM49BAMCA0kAMEYCIQCmkeYO
7qrsL+K7lD+83jwG1kwlUjmk7j8TiMRZugoXggIhAKjU1921/HtVg5vruWnAldE0
OluYL3u0qG/zUnQBBZdU
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuzCCAWKgAwIBAgIRAOh3pVKIyi62jzzF+fxZZ38wCgYIKoZIzj0EAwIwLTEV
MBMGA1UEAwwMQUNLIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwEMTM3QTAeFw0y
MjEwMDYyMDAzNDVaFw0yMzEwMDYyMTAzNDVaMC0xFTATBgNVBAMMDEFDSyBUZXN0
IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDEzN0EwWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAAQ/A05IPxIIzR0JlOJsrVFWchOD7a4n+cS9cuo2uX3VAJtZo76cQIyAH2+q
A5cXCMu1Zz6usnGrIb/romDbah8yo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud
DgQWBBR5tgRpKKdeSNjbz17/o/nb5fWDeDAOBgNVHQ8BAf8EBAMCAYYwHwYDVR0j
BBgwFoAUebYEaSinXkjY289e/6P52+X1g3gwCgYIKoZIzj0EAwIDRwAwRAIgWUD0
xLr2FYyVoMzrYMeBS4k5yBpgOFy2lmCd1fbwqUICIAxr0LCI2jDduTxnR/YNbcAx
cxTw3DvHgFVC2NzdHsuj
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBzjCCAXSgAwIBAgIIc5yeGDalj1UwCgYIKoZIzj0EAwIwOTEhMB8GA1UEAwwY
QmVrZW4gRGV2ZWxvcG1lbnQgUEFBIDAxMRQwEgYKKwYBBAGConwCAQwEMTM0MjAe
Fw0yMjEwMTAxNDIzNDNaFw00MjEwMTAxNDIzNDJaMDkxITAfBgNVBAMMGEJla2Vu
IERldmVsb3BtZW50IFBBQSAwMTEUMBIGCisGAQQBgqJ8AgEMBDEzNDIwWTATBgcq
hkjOPQIBBggqhkjOPQMBBwNCAAQ7RjKxo8kR3YOFYhALOnwZ6Ob3lMat0lltuvzv
tMsdyaD/hfB4+moxkWNDOTTjGMjIHIsANgCI/531RDRqZ1WFo2YwZDASBgNVHRMB
Af8ECDAGAQH/AgEBMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUwrzWQPP16qF6
7EZqS2lIuWrNDXowHwYDVR0jBBgwFoAUwrzWQPP16qF67EZqS2lIuWrNDXowCgYI
KoZIzj0EAwIDSAAwRQIhAMQEa0y9YDbmxw4sH0tsTUR401k2ikOAoPtlhbAJ7kc+
AiAuZvx5Dx2B4jEH7Q6fmeUvecU9VSCmC+WMOtN4bUPt4w==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
-----BEGIN CERTIFICATE-----
MIIB7DCCAZKgAwIBAgIQMV46uClrVWJ4ZxcpJqr22DAKBggqhkjOPQQDAjBVMQsw
MIICETCCAbagAwIBAgIQFyReo7LqWopgbkJvcgr05TAKBggqhkjOPQQDAjBVMQsw
CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLTArBgNVBAMTJERp
Z2lDZXJ0IFRFU1QgUm9vdCBDQSBmb3IgTUFUVEVSIFBLSTAgFw0yMjA2MDEwMDAw
MDBaGA85OTk5MTIzMTIzNTk1OVowVTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRp
Z2lDZXJ0LCBJbmMuMS0wKwYDVQQDEyREaWdpQ2VydCBURVNUIFJvb3QgQ0EgZm9y
IE1BVFRFUiBQS0kwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAQChzJYO4tGlo0J
YR48DhcqbhiPsYM+I4iDQ44pCQiy1tt2k3lwpo2w6VtqNzj2rwHicsRNsC68c9wD
IaPmNeuTo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNV
HQ4EFgQUwOBkFQDsZ+J8r3xuLUmUx3Pet7owCgYIKoZIzj0EAwIDSAAwRQIgRQv2
ij1REVJ0UnqknV1XqCtsZOgBUOjCXlFp9nxQtoACIQCK0ehUL8ewgYWGzByw9yWs
WBmRC9nEToE88lIXCAWbUg==
IaPmNeuTo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMB0GA1UdDgQWBBTA4GQVAOxn
4nyvfG4tSZTHc963ujAOBgNVHQ8BAf8EBAMCAQYwHwYDVR0jBBgwFoAUwOBkFQDs
Z+J8r3xuLUmUx3Pet7owCgYIKoZIzj0EAwIDSQAwRgIhANQPosj8Q06GATusRAtX
VQFXJSSm8AgsulWwI35mEf22AiEAxiY2sTXcV3ZUiNl/O4RQ10UWMRMjrgo076cn
zy5r7zE=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB3jCCAYSgAwIBAgIIZ0Wr5EH9GF0wCgYIKoZIzj0EAwIwQTEpMCcGA1UEAwwg
RUxpdGV1IE1hdHRlciBEZXZlbG9wbWVudCBQQUEgMDExFDASBgorBgEEAYKifAIB
DAQxMzFGMB4XDTIyMTAxMDE0MDAwMFoXDTQyMTAxMDEzNTk1OVowQTEpMCcGA1UE
AwwgRUxpdGV1IE1hdHRlciBEZXZlbG9wbWVudCBQQUEgMDExFDASBgorBgEEAYKi
fAIBDAQxMzFGMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEVhmkmlF4bsZhaPBa
+sop1cPkW9Kwa2zRJY+bCtqJEWA6Y8EPk4Hq+Vx7L3RZJdA/dgqJRfrMWJG7uMT7
DAdgGqNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYD
VR0OBBYEFNN/BuHbYf5ymSl9lcFPG2QHWENzMB8GA1UdIwQYMBaAFNN/BuHbYf5y
mSl9lcFPG2QHWENzMAoGCCqGSM49BAMCA0gAMEUCIQCcjSilivNmAJtkj0A/utii
BNrK8jl4yLq3JwAjKR/pNwIgVygv+9XbvzNTGZoQ8mM2d74vIZ+1y1XH3nM0Xggf
2HE=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBpjCCAUygAwIBAgIIJj1Z6cFTVHcwCgYIKoZIzj0EAwIwJDEiMCAGA1UEAwwZ
R292ZWUgVGVzdCBQQUEsdmlkPTB4MTM4NzAgFw0yMjA3MTAxNDIzNDNaGA85OTk5
MTIzMTIzNTk1OVowJDEiMCAGA1UEAwwZR292ZWUgVGVzdCBQQUEsdmlkPTB4MTM4
NzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABE3GwFGazJj0Kj6f7IwcIr4OoMwh
EwVNDEZ+UR00ZeJzd+8uGXLjyKZ6v//B34p4RvKJMk+Gq6uF6G6GT1ZXLCOjZjBk
MBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTb
Y6ZTwaH+psljqWJ1ewuBEPWA9DAfBgNVHSMEGDAWgBTbY6ZTwaH+psljqWJ1ewuB
EPWA9DAKBggqhkjOPQQDAgNIADBFAiEAy7R/7blSlNX8WZGQrn63peA493kvYThb
zvmitcKy5fgCIFDvHKy7xkwWUmpcKyDGZn4tYIzvIwm0FvYl1V3mxdaR
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBvDCCAWKgAwIBAgIIBrNU/eDFaWIwCgYIKoZIzj0EAwIwLzEXMBUGA1UEAwwO
R292ZWUgVGVzdCBQQUExFDASBgorBgEEAYKifAIBDAQxMzg3MCAXDTIyMDcxMDE0
MjM0M1oYDzk5OTkxMjMxMjM1OTU5WjAvMRcwFQYDVQQDDA5Hb3ZlZSBUZXN0IFBB
QTEUMBIGCisGAQQBgqJ8AgEMBDEzODcwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC
AATl/ZzC+tS/NiBWPrpBbgchrOxdpPUpwRXOd5u+tkWA+7d2xEYSuYYL/BpolCCJ
hxKp+XoFYM0zvnU0uOPWhirto2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMA4GA1Ud
DwEB/wQEAwIBBjAdBgNVHQ4EFgQUk4YyXgbZseQmMESNNOb7SNUM7SUwHwYDVR0j
BBgwFoAUk4YyXgbZseQmMESNNOb7SNUM7SUwCgYIKoZIzj0EAwIDSAAwRQIgJeX5
H6GY+nhDObPbinkoEDAweQOOYSPfsgUbypL4yrYCIQCksMRPy62kSdxfaTmR1C4K
gYU/+xitxnDp3AmKJKhWeg==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBxjCCAWygAwIBAgIIYEQ9AfaLNYYwCgYIKoZIzj0EAwIwNDEcMBoGA1UEAwwT
SGFpZXItTWF0dGVyLVBBQS0wMTEUMBIGCisGAQQBgqJ8AgEMBDEzNDgwIBcNMjIx
MDAxMDAwMDAwWhgPMjIyMjEwMDIyMzU5NTlaMDQxHDAaBgNVBAMME0hhaWVyLU1h
dHRlci1QQUEtMDExFDASBgorBgEEAYKifAIBDAQxMzQ4MFkwEwYHKoZIzj0CAQYI
KoZIzj0DAQcDQgAEGwzQmLOYzyfR8zgxQKB3Y1FiFmlACYiFUJ5vgO1zg69sck9c
cq95hXRsPUirHNQ7IkH6c0b3MYhGCimiKeXD9aNmMGQwEgYDVR0TAQH/BAgwBgEB
/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFFsjg5exUHGu9YHHsqt2vlbk
NGriMB8GA1UdIwQYMBaAFFsjg5exUHGu9YHHsqt2vlbkNGriMAoGCCqGSM49BAMC
A0gAMEUCIQCfk1qC0eCKdp/VvPiv8fvnQWnfOgFJQCAKmb1Qp1CIIAIgN9zymm1c
FwdwvNhapM3Fsgl5n1J5y7+/fOnVi3kudgs=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIByjCCAXCgAwIBAgIIV6JKD+XnRIIwCgYIKoZIzj0EAwIwNzEfMB0GA1UEAwwW
TWVyb3NzIERldmVsb3BtZW50IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDEzNDUwHhcN
MjAxMDE1MTQyMzQzWhcNNDAxMDE1MTQyMzQyWjA3MR8wHQYDVQQDDBZNZXJvc3Mg
RGV2ZWxvcG1lbnQgUEFBMRQwEgYKKwYBBAGConwCAQwEMTM0NTBZMBMGByqGSM49
AgEGCCqGSM49AwEHA0IABMe80DYo2TUwp2KmundT1Jg4c6+FokdLtM5saZMd0nLl
f8eryFpP1yf1/IvE2vpKQKq3eirtjQw1qGPNCbG2+CejZjBkMBIGA1UdEwEB/wQI
MAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSTcZ6kFxCT9n6v5jpS
xRlH7j5aqDAfBgNVHSMEGDAWgBSTcZ6kFxCT9n6v5jpSxRlH7j5aqDAKBggqhkjO
PQQDAgNIADBFAiEA4uhwfF4Nw8rna6gYZV03lEQG2wEwIzo83OiTcknqPC0CIGLG
79IPfTibBunADTztyXRIKwNF7S2+Or8Xc8nsQ4WV
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBsTCCAVigAwIBAgIId8qAUP/Yx8EwCgYIKoZIzj0EAwIwKjESMBAGA1UEAwwJ
TWlkZWEgUEFBMRQwEgYKKwYBBAGConwCAQwEMTE4QzAgFw0yMTA2MjgxNDIzNDNa
GA85OTk5MTIzMTIzNTk1OVowKjESMBAGA1UEAwwJTWlkZWEgUEFBMRQwEgYKKwYB
BAGConwCAQwEMTE4QzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABNSDqXBAwy7+
LxfbIxFBUja2JiogiMYMvPCVE1ZC2oVGbif17/9nIxYbKHQX3n4QMeR0xpn60OKx
cWiNd6meNE6jZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEG
MB0GA1UdDgQWBBQSX9Aagss/AwlQ6JWVprNY9SpalDAfBgNVHSMEGDAWgBQSX9Aa
gss/AwlQ6JWVprNY9SpalDAKBggqhkjOPQQDAgNHADBEAiBoZq5htW2zMEhKXp9/
JR+KPraZp4oVGh8ZK1IVSbOwagIgQ6Psk09HUrO7Fsgk4/FZqlBuoFQ6+WbfACu/
5Ijq4O0=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuTCCAWCgAwIBAgIIculuDGZCLSQwCgYIKoZIzj0EAwIwLjEWMBQGA1UEAwwN
T1BQTyBUZXN0IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDEzNDEwIBcNMjEwNjI4MTQy
MzQzWhgPOTk5OTEyMzEyMzU5NTlaMC4xFjAUBgNVBAMMDU9QUE8gVGVzdCBQQUEx
FDASBgorBgEEAYKifAIBDAQxMzQxMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE
4NbEMTKhymmaM81O9F6MIdC3UEpYRRkbKj+jq81qIvMoSQRVrcFSABir6S4nP4pI
K00Wo5eYcMwunu7Rb1+TYKNmMGQwEgYDVR0TAQH/BAgwBgEB/wIBATAOBgNVHQ8B
Af8EBAMCAQYwHQYDVR0OBBYEFMyJ4O3dahIP1NEztGk/BdUX5xPvMB8GA1UdIwQY
MBaAFMyJ4O3dahIP1NEztGk/BdUX5xPvMAoGCCqGSM49BAMCA0cAMEQCIHgoNVBU
zlr/rbfgtNKXQ/ilwW9BTTkw8CNr7iY6vIqsAiBh1VXKrhwDfwVQ518Un1KuGTfi
kA7JtstGj2BddjUFSg==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB4DCCAYagAwIBAgIUBzI2y6CNoaCZRSSlwdp0YReVN7wwCgYIKoZIzj0EAwIw
OzElMCMGA1UEAwwcU3Ryb25nS2V5IEcxIERldmVsb3BtZW50IFBBQTESMBAGA1UE
CgwJU3Ryb25nS2V5MCAXDTIyMDgxNzAwMTE1NloYDzk5OTkxMjMxMjM1OTU5WjA7
MSUwIwYDVQQDDBxTdHJvbmdLZXkgRzEgRGV2ZWxvcG1lbnQgUEFBMRIwEAYDVQQK
DAlTdHJvbmdLZXkwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARnHLUaS+BJwLPB
7SCwLepeBtVH2XhGZBc59LP8efMKlL93f1ov0VJQi/i8zliiCWIDy8kUSzlxHs+7
pLqoYIhCo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEBMB8GA1UdIwQYMBaAFHzLA5q1
aev81dsMZDYLPx2GPIcuMB0GA1UdDgQWBBR8ywOatWnr/NXbDGQ2Cz8dhjyHLjAO
BgNVHQ8BAf8EBAMCAQYwCgYIKoZIzj0EAwIDSAAwRQIhAO5zMiVkAWP/9zVhdN3A
23bzLrRasxMC3qDDpQyMlyMKAiB9DvCoRAt+eD5+HKQMm245vJ57NePvosuiM5oz
xzbsqQ==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBzjCCAXSgAwIBAgIIAqMH90Sy494wCgYIKoZIzj0EAwIwODEgMB4GA1UEAwwX
VFAtTGluayBNYXR0ZXIgVGVzdCBQQUExFDASBgorBgEEAYKifAIBDAQxMTg4MCAX
DTIxMDYyODE0MjM0M1oYDzk5OTkxMjMxMjM1OTU5WjA4MSAwHgYDVQQDDBdUUC1M
aW5rIE1hdHRlciBUZXN0IFBBQTEUMBIGCisGAQQBgqJ8AgEMBDExODgwWTATBgcq
hkjOPQIBBggqhkjOPQMBBwNCAATcnLu4AofTjqLNrZjPf+RV28sommDityDY65F8
Kg0VLZn6LjfspedzLJunVTTuftBewdySlb4/lx8AtocyBkS3o2YwZDASBgNVHRMB
Af8ECDAGAQH/AgEBMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUdqY/wPeRT+rf
3dOd8BgWRwF9cV8wHwYDVR0jBBgwFoAUdqY/wPeRT+rf3dOd8BgWRwF9cV8wCgYI
KoZIzj0EAwIDSAAwRQIhALUi1VbKwRIhQyYDtUOUm4G3CU0hD0lscb4+CI5D4XMi
AiACSnX2ca2oOre7SidIUdLfO2MX++rZyfqWDmPMzHSdTw==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIByzCCAXKgAwIBAgIIbANLDZfoeYcwCgYIKoZIzj0EAwIwODEgMB4GA1UEAwwX
ZGV2ZXJpdGVjIEdtYkggVGVzdCBQQUExFDASBgorBgEEAYKifAIBDAQxMzYyMB4X
DTIyMTAxMjAwMDAwMFoXDTMyMTAwODIzNTk1OVowODEgMB4GA1UEAwwXZGV2ZXJp
dGVjIEdtYkggVGVzdCBQQUExFDASBgorBgEEAYKifAIBDAQxMzYyMFkwEwYHKoZI
zj0CAQYIKoZIzj0DAQcDQgAEaG/rXkBXUoMSMkYI0/9VDScmqoY2n3ktojBq3YEf
eCBPDQBaJlL48IRFTcR09bpuGMYgbNTH6M8i36IrjU+OiaNmMGQwEgYDVR0TAQH/
BAgwBgEB/wIBATAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFIC/kimaZjzaNI+i
TYBz9PGDJD42MB8GA1UdIwQYMBaAFIC/kimaZjzaNI+iTYBz9PGDJD42MAoGCCqG
SM49BAMCA0cAMEQCIHp7fR5Mj2HqqtqTEHqFCApvTYCDy1fv8WwTUiqv7TTzAiA4
yyB38NIexJzRZjmEUcyrD3f2HRw5qEI9s6kHLLMF7w==
-----END CERTIFICATE-----
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
# Usage example when the script is run from the CHIP SDK root directory:
# python ./credentials/development/fetch-development-paa-certs-from-dcl.py /path/to/dcld
#
# Usage example when the script is run from the CHIP SDK root directory for fetching production PAAs:
# python ./credentials/development/fetch-development-paa-certs-from-dcl.py /path/to/dcld production
#
# The result will be stored in:
# credentials/development/paa-root-certs
# In case of production - 2nd usage example above - the result will be stored in:
# credentials/production/paa-root-certs
#

from contextlib import nullcontext
import os
import sys
import subprocess
Expand All @@ -35,6 +41,8 @@
from cryptography.hazmat.primitives import serialization
from cryptography import x509

PRODUCTION_NODE_URL = 'https://on.dcl.csa-iot.org:26657'


def parse_paa_root_certs(cmdpipe, paa_list):
"""
Expand Down Expand Up @@ -77,11 +85,11 @@ def parse_paa_root_certs(cmdpipe, paa_list):
paa_list.append(copy.deepcopy(result))


def write_paa_root_cert(cmdpipe, subject):
def write_paa_root_cert(cmdpipe, subject, prefix):
pem_read = False
subject_as_text_read = False

filename = 'paa-root-certs/dcld_mirror_' + \
filename = prefix + 'paa-root-certs/dcld_mirror_' + \
re.sub('[^a-zA-Z0-9_-]', '', re.sub('[=, ]', '_', subject))
with open(filename + '.pem', 'wb+') as outfile:
while True:
Expand All @@ -98,7 +106,7 @@ def write_paa_root_cert(cmdpipe, subject):
break
if b'subjectAsText:' in line:
new_subject = line.split(b': ')[1].strip().decode("utf-8")
new_filename = 'paa-root-certs/dcld_mirror_' + \
new_filename = prefix + 'paa-root-certs/dcld_mirror_' + \
re.sub('[=,\\\\ ]', '_', new_subject)
subject_as_text_read = True
break
Expand All @@ -116,31 +124,42 @@ def write_paa_root_cert(cmdpipe, subject):


def main():
if len(sys.argv) == 2:
if len(sys.argv) >= 2:
dcld = sys.argv[1]
else:
sys.exit(
"Error: Please specify exactly one input argument; the path to the dcld tool binary")

production = False
if len(sys.argv) >= 3:
if sys.argv[2] == "production":
production = True

previous_dir = os.getcwd()
abspath = os.path.dirname(sys.argv[0])
os.chdir(abspath)

os.makedirs('paa-root-certs', exist_ok=True)

cmdpipe = subprocess.Popen([dcld, 'query', 'pki', 'all-x509-root-certs'],
cmdlist = ['query', 'pki', 'all-x509-root-certs']
production_node_cmdlist = ['--node', PRODUCTION_NODE_URL]

cmdpipe = subprocess.Popen([dcld] + cmdlist + production_node_cmdlist if production else [],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

paa_list = []
parse_paa_root_certs.counter = 0
parse_paa_root_certs(cmdpipe, paa_list)

for paa in paa_list:

cmdlist = ['query', 'pki', 'x509-cert', '-u',
paa[b'subject'].decode("utf-8"), '-k', paa[b'subjectKeyId'].decode("utf-8")]

cmdpipe = subprocess.Popen(
[dcld, 'query', 'pki', 'x509-cert', '-u',
paa[b'subject'].decode("utf-8"), '-k', paa[b'subjectKeyId'].decode("utf-8")],
[dcld] + cmdlist + production_node_cmdlist if production else [],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
write_paa_root_cert(cmdpipe, paa[b'subject'].decode("utf-8"))
write_paa_root_cert(cmdpipe, paa[b'subject'].decode("utf-8"), "production/" if production else "development/")

os.chdir(previous_dir)

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICDTCCAbKgAwIBAgIQe3eNNaVHZutrY7gRg4ItsjAKBggqhkjOPQQDAjBTMQsw
CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xKzApBgNVBAMTIkRp
Z2lDZXJ0IFJvb3QgQ0EgZm9yIE1BVFRFUiBQS0kgRzEwIBcNMjIwODI0MDAwMDAw
WhgPOTk5OTEyMzEyMzU5NTlaMFMxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdp
Q2VydCwgSW5jLjErMCkGA1UEAxMiRGlnaUNlcnQgUm9vdCBDQSBmb3IgTUFUVEVS
IFBLSSBHMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABAVbq6wD9zzDXbEObnSN
OMNLrGyLBok/Le7bYMzRBn8G4aNSEDw1ClO4gAbrZqpDJy5QSmF9VpKPx9FOsvmV
bZujZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1Ud
DgQWBBQyUEUZM0RZm0Zl1Fn9OhXxwRbMvTAfBgNVHSMEGDAWgBQyUEUZM0RZm0Zl
1Fn9OhXxwRbMvTAKBggqhkjOPQQDAgNJADBGAiEAh88I/wwZ6/x4wrLLZeEZZEQi
KqmgvTeRD3kPQ1LoCFgCIQCKVfavo16G+mSmMEFD2O/vsx15c2U1SS0rTK/ogRAP
4g==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE-----
MIICATCCAaegAwIBAgIHY3Nhcm9vdDAKBggqhkjOPQQDAjBSMQwwCgYDVQQKDAND
U0ExLDAqBgNVBAMMI01hdHRlciBDZXJ0aWZpY2F0aW9uIGFuZCBUZXN0aW5nIENB
MRQwEgYKKwYBBAGConwCAQwEQzVBMDAgFw0yMjA3MDcxOTI4MDRaGA8yMTIyMDYx
MzE5MjgwNFowUjEMMAoGA1UECgwDQ1NBMSwwKgYDVQQDDCNNYXR0ZXIgQ2VydGlm
aWNhdGlvbiBhbmQgVGVzdGluZyBDQTEUMBIGCisGAQQBgqJ8AgEMBEM1QTAwWTAT
BgcqhkjOPQIBBggqhkjOPQMBBwNCAAQ4SjrDql2+y3IP5iEdPK1IYm/3EaCkkp+t
2GD44nf/wN4fPrYzejSEe1o6BW6ocQ6Td+7t7iUXA/3ZNQEly45Io2YwZDASBgNV
HRMBAf8ECDAGAQH/AgEBMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUl+Rp0MUE
FMJvxwH3fpR3OQmN9qUwHwYDVR0jBBgwFoAUl+Rp0MUEFMJvxwH3fpR3OQmN9qUw
CgYIKoZIzj0EAwIDSAAwRQIgearlB0fCJ49UoJ6xwKPdlPEopCOL9jVCviODEleI
+mQCIQDvvDCKi7kvj4R4BoFS4BVZGCk4zJ84W4tfTTfu89lRbQ==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIB1DCCAXygAwIBAgIUc2o+vqQtP7EOoBw7/O0Wpob9HWUwCgYIKoZIzj0EAwIw
NjEgMB4GA1UEAwwXU3Ryb25nS2V5IE1hdHRlciBHMSBQQUExEjAQBgNVBAoMCVN0
cm9uZ0tleTAgFw0yMjA5MTMyMTIyMzVaGA85OTk5MTIzMTIzNTk1OVowNjEgMB4G
A1UEAwwXU3Ryb25nS2V5IE1hdHRlciBHMSBQQUExEjAQBgNVBAoMCVN0cm9uZ0tl
eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEqgWEHD/XHc8QXOrtjCZn6x34i1
l/vM1nYVdGfNT7HGQojTd3TMjKWQppKcTnl7pN6ua3XmuJQCm/RekenBvcujZjBk
MBIGA1UdEwEB/wQIMAYBAf8CAQEwHwYDVR0jBBgwFoAUN04pWsVRcwuvZdUpg5tO
4J05WIowHQYDVR0OBBYEFDdOKVrFUXMLr2XVKYObTuCdOViKMA4GA1UdDwEB/wQE
AwIBBjAKBggqhkjOPQQDAgNGADBDAh8a5dw6CObybMr8nqaou9lv9PqPbj3DSd+c
yQm19Mg7AiAVcSK0RXTwLjAef55gWgq7SBRM/u3f3nRV/fvCYgWZfA==
-----END CERTIFICATE-----

0 comments on commit 9829444

Please sign in to comment.