Skip to content

Commit 1dce716

Browse files
authored
Merge pull request italia#732 from italia/x509-fix
fix: x509 chain example. Added x509 chain gen util
2 parents 8cf0684 + 1187a31 commit 1dce716

File tree

3 files changed

+401
-149
lines changed

3 files changed

+401
-149
lines changed

docs/en/trust.rst

Lines changed: 3 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -802,156 +802,10 @@ When a participant self-issues an X.509 Certificate, it adheres to the following
802802
- ``DNS=example.net``
803803
- ``DNS=*.example.org``
804804

805-
Below a non-normative example of an X.509 Certificate Chain without intermediaries and in plain text, to facilitate the reading.
805+
Below is a non-normative example, in plain text (OpenSSL format), of an X.509 certificate chain with an intermediate CA, starting from the Leaf certificate.
806806

807-
808-
.. code-block:: text
809-
810-
Certificate:
811-
Data:
812-
Version: 3 (0x2)
813-
Serial Number: 1 (0x1)
814-
Signature Algorithm: sha256WithRSAEncryption
815-
Issuer: CN=trust-anchor.example.com, O=Example Trust Anchor, C=IT
816-
Validity
817-
Not Before: Sep 1 00:00:00 2023 GMT
818-
Not After : Sep 1 00:00:00 2033 GMT
819-
Subject: CN=trust-anchor.example.com, O=Example Trust Anchor, C=IT
820-
Subject Public Key Info:
821-
Public Key Algorithm: rsaEncryption
822-
Public-Key: (4096 bit)
823-
Modulus:
824-
00:af:82:3b:...
825-
Exponent: 65537 (0x10001)
826-
X509v3 extensions:
827-
X509v3 Basic Constraints:
828-
CA:TRUE
829-
X509v3 Key Usage:
830-
Certificate Sign, CRL Sign
831-
X509v3 Subject Key Identifier:
832-
12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef
833-
X509v3 Authority Key Identifier:
834-
keyid:12:34:56:78:90:ab:cd:ef:12:34:56:78:90:ab:cd:ef
835-
X509v3 CRL Distribution Points:
836-
Full Name:
837-
URI:https://trust-anchors.example.com/crl/ca.crl
838-
839-
Signature Algorithm: sha256WithRSAEncryption
840-
5c:4f:3b:...
841-
842-
843-
Certificate:
844-
Data:
845-
Version: 3 (0x2)
846-
Serial Number: 1234567890 (0x499602d2)
847-
Signature Algorithm: sha256WithRSAEncryption
848-
Issuer: CN=trust-anchor.example.com, O=Example Trust Anchor, C=IT
849-
Validity
850-
Not Before: Sep 1 00:00:00 2023 GMT
851-
Not After : Sep 1 00:00:00 2024 GMT
852-
Subject: CN=leaf.example.org, O=Leaf, C=IT
853-
Subject Public Key Info:
854-
Public Key Algorithm: rsaEncryption
855-
Public-Key: (2048 bit)
856-
Modulus:
857-
00:af:82:3b:...
858-
Exponent: 65537 (0x10001)
859-
X509v3 extensions:
860-
X509v3 Basic Constraints:
861-
CA:TRUE, pathlen:1
862-
X509v3 Key Usage:
863-
Digital Signature, Key Encipherment
864-
X509v3 Subject Alternative Name:
865-
URI:https://leaf.example.com
866-
X509v3 Name Constraints:
867-
Permitted:
868-
URI.1=https://leaf.example.com
869-
DNS.1=leaf.example.com
870-
Excluded:
871-
DNS=localhost
872-
DNS=localhost.localdomain
873-
DNS=127.0.0.1
874-
DNS=example.com
875-
DNS=example.org
876-
DNS=example.net
877-
DNS=*.example.org
878-
X509v3 CRL Distribution Points:
879-
Full Name:
880-
URI:https://trust-ancor.example.com/crl/leaf.example.org.crl
881-
882-
Signature Algorithm: sha256WithRSAEncryption
883-
5c:4f:3b:...
884-
885-
886-
Certificate:
887-
Data:
888-
Version: 3 (0x2)
889-
Serial Number: 987654321 (0x3ade68b1)
890-
Signature Algorithm: sha256WithRSAEncryption
891-
Issuer: CN=https://leaf.example.org, O=Leaf, C=IT
892-
Validity
893-
Not Before: Sep 1 00:00:00 2023 GMT
894-
Not After : Sep 1 00:00:00 2024 GMT
895-
Subject: CN=https://leaf.example.org, O=Leaf, C=IT
896-
Subject Public Key Info:
897-
Public Key Algorithm: rsaEncryption
898-
Public-Key: (2048 bit)
899-
Modulus:
900-
00:af:82:3b:...
901-
Exponent: 65537 (0x10001)
902-
X509v3 extensions:
903-
X509v3 Basic Constraints:
904-
CA:FALSE
905-
X509v3 Key Usage:
906-
Digital Signature, Key Encipherment
907-
X509v3 Subject Alternative Name:
908-
URI:https://leaf.example.org
909-
X509v3 Name Constraints:
910-
Permitted:
911-
URI.1=https://leaf.example.com
912-
DNS.1=leaf.example.com
913-
X509v3 CRL Distribution Points:
914-
Full Name:
915-
URI:https://leaf.example.org/crl/self.crl
916-
917-
Signature Algorithm: sha256WithRSAEncryption
918-
7d:6e:5f:...
919-
920-
921-
Federation participants can ensure that their certificates are consistent, enabling interoperability and security across the federation. This approach, enabling X.509 certificate issuance delegation, introduces innovative practices for certificate management using the underlying Trust Relationships established within the OpenID Federation.
922-
923-
924-
X.509 Certificate Revocation
925-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
926-
927-
An X.509 Certificate can be revoked by its Issuer.
928-
Revocation lists, and or any other revocation check mechanisms, are required only for X.509 Certificate with expiration time superior to 24 hours, otherwise they are not required.
929-
930-
When the X.509 Certificate issuer is the Leaf and therefore the X.509 Certificate is about itself, if the certificate expiration time is superior than 24 hours from the ``X509_NOT_VALID_BEFORE`` time, it MUST implement a CRL about the issued certificate and keep it updated.
931-
When the X.509 Certificate issuer is an Immediate superior, such as the Trust Anchor or a Intermediate, and it revokes the certificate about the Leaf, therefore the X.509 Certificate about one of the Leaves Federation Entity Key. This action invalidates the entire Trust Chain associated with that Leaf's cryptographic public key, effectively removing its ability to issue further X.509 Certificates about itself. This hierarchical revocation mechanism ensures that any compromise or misbehavior by a Leaf entity can be swiftly addressed.
932-
933-
Below a non-normative example, in plain text, examplify the content of a CRL.
934-
935-
.. code-block:: text
936-
937-
Certificate Revocation List (CRL):
938-
Version: 2 (0x1)
939-
Signature Algorithm: sha256WithRSAEncryption
940-
Issuer: CN=https://leaf.example.org, O=Leaf, C=IT
941-
Last Update: Sep 1 00:00:00 2023 GMT
942-
Next Update: Sep 8 00:00:00 2023 GMT
943-
Revoked Certificates:
944-
Serial Number: 987654320
945-
Revocation Date: Aug 25 12:00:00 2023 GMT
946-
CRL Entry Extensions:
947-
Reason Code: Key Compromise
948-
Serial Number: 987654321
949-
Revocation Date: Aug 30 15:00:00 2023 GMT
950-
CRL Entry Extensions:
951-
Reason Code: Cessation of Operation
952-
Signature Algorithm: sha256WithRSAEncryption
953-
Signature:
954-
5c:4f:3b:...
807+
.. literalinclude:: ../../examples/x5c.json
808+
:language: text
955809

956810
Using the underlying layer established with OpenID Federation 1.0, all X.509 certificates are issued in a properly decentralized manner using the delegation pattern.
957811

examples/x5c.json

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
Certificate:
2+
Data:
3+
Version: 3 (0x2)
4+
Serial Number: 631900975802917176051117802358049194750736752223 (0x6eaf6b7456ab3c0a4b38f02bb6073db7ce925e5f)
5+
Signature Algorithm: sha256
6+
Issuer: commonName=https://intermediate.example.net, organizationName=Example INT, countryName=IT
7+
Validity
8+
Not Before: May 27 09:13:33 2025 GMT
9+
Not After : May 28 09:13:33 2026 GMT
10+
Subject: commonName=CN=leaf.example.com, O=Example Leaf, C=IT, organizationName=Example Leaf, countryName=IT
11+
Subject Public Key Info:
12+
Public Key Algorithm: id-ecPublicKey (EC)
13+
Public-Key: (256 bit)
14+
Curve: secp256r1
15+
X: 69976109031737194756970051761651042204906873292535726068007861307666294009468
16+
Y: 30041520431409736411496718565679258429461229569083348196905050642324938424017
17+
X509v3 extensions:
18+
X509v3 Basic Constraints:
19+
CA:TRUE, pathlen:0
20+
X509v3 Subject Alternative Name:
21+
DNS:leaf.example.org
22+
URI:leaf.example.org
23+
X509v3 Key Usage:
24+
Digital Signature, Key Encipherment, Certificate Sign, CRL Sign
25+
X509v3 CRL Distribution Points:
26+
Full Name:
27+
URI:https://leaf.example.com/crl/leaf.example.com.crl
28+
X509v3 Name Constraints:
29+
Permitted:
30+
URI.1=https://leaf.example.com
31+
DNS.2=leaf.example.com
32+
Excluded:
33+
DNS.1=localhost
34+
DNS.2=localhost.localdomain
35+
DNS.3=127.0.0.1
36+
DNS.4=example.com
37+
DNS.5=example.org
38+
DNS.6=example.net
39+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YDALgglsb2Nh
60+
bGhvc3QwF4IVbG9jYWxob3N0LmxvY2FsZG9tYWluMAuCCTEyNy4wLjAuMTANggtl
61+
eGFtcGxlLmNvbTANggtleGFtcGxlLm9yZzANggtleGFtcGxlLm5ldDAKBggqhkjO
62+
PQQDAgNIADBFAiEA7gwkTOpX2/hUaHeSvdfjPeyAToS0NnDzAAvwz78HwUoCIHAe
63+
EuTEl7qVNugggtbxf00NQUpRCsWyXWIzRcWw3CgK
64+
-----END CERTIFICATE-----
65+
66+
Certificate:
67+
Data:
68+
Version: 3 (0x2)
69+
Serial Number: 396534572491127113022787686743653095280228078403 (0x457539a6ac314749fa5ec658f76ed225fd769343)
70+
Signature Algorithm: sha256
71+
Issuer: commonName=CN=ca.example.com, O=Example CA, C=IT, organizationName=Example CA, countryName=IT
72+
Validity
73+
Not Before: May 27 09:13:33 2025 GMT
74+
Not After : May 28 09:13:33 2026 GMT
75+
Subject: commonName=https://intermediate.example.net, organizationName=Example INT, countryName=IT
76+
Subject Public Key Info:
77+
Public Key Algorithm: id-ecPublicKey (EC)
78+
Public-Key: (256 bit)
79+
Curve: secp256r1
80+
X: 25156074883156693989891139993064608529947553342874167037412394938695986639833
81+
Y: 37747901399770759266458300753958501018530290808445029579181649667235295170256
82+
X509v3 extensions:
83+
X509v3 Basic Constraints:
84+
CA:TRUE, pathlen:1
85+
X509v3 Key Usage:
86+
Digital Signature, Key Encipherment, Certificate Sign, CRL Sign
87+
X509v3 CRL Distribution Points:
88+
Full Name:
89+
URI:https://intermediate.example.net/crl/intermediate.example.net.crl
90+
X509v3 Name Constraints:
91+
Excluded:
92+
DNS.1=localhost
93+
DNS.2=localhost.localdomain
94+
DNS.3=127.0.0.1
95+
DNS.4=example.com
96+
DNS.5=example.org
97+
DNS.6=example.net
98+
99+
Signature Algorithm: sha256
100+
30:46:02:21:00:cb:1d:01:ee:1b:bf:a1:4d:36:42:d2
101+
0a:7e:80:37:44:e6:e0:ae:6c:70:58:ea:4c:60:00:af
102+
53:3b:11:f6:66:02:21:00:c6:08:73:d8:45:7e:e8:e9
103+
5e:be:5b:68:9e:12:e9:a2:8e:95:31:01:1d:9e:99:04
104+
17:d3:f3:54:71:1b:9f:ac
105+
106+
-----BEGIN CERTIFICATE-----
107+
MIICjzCCAjSgAwIBAgIURXU5pqwxR0n6XsZY927SJf12k0MwCgYIKoZIzj0EAwIw
108+
UjEuMCwGA1UEAwwlQ049Y2EuZXhhbXBsZS5jb20sIE89RXhhbXBsZSBDQSwgQz1J
109+
VDETMBEGA1UECgwKRXhhbXBsZSBDQTELMAkGA1UEBhMCSVQwHhcNMjUwNTI3MDkx
110+
MzMzWhcNMjYwNTI4MDkxMzMzWjBOMSkwJwYDVQQDDCBodHRwczovL2ludGVybWVk
111+
aWF0ZS5leGFtcGxlLm5ldDEUMBIGA1UECgwLRXhhbXBsZSBJTlQxCzAJBgNVBAYT
112+
AklUMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEN53VdNZrwDIEoleHOjbgNAA9
113+
Ab6PeLajowvmkPNm89lTdI4YecjNJYS35wyhMEt+opXZukysBjRRO84M8I6O0KOB
114+
6zCB6DASBgNVHRMBAf8ECDAGAQH/AgEBMA4GA1UdDwEB/wQEAwIBpjBSBgNVHR8E
115+
SzBJMEegRaBDhkFodHRwczovL2ludGVybWVkaWF0ZS5leGFtcGxlLm5ldC9jcmwv
116+
aW50ZXJtZWRpYXRlLmV4YW1wbGUubmV0LmNybDBuBgNVHR4BAf8EZDBioWAwC4IJ
117+
bG9jYWxob3N0MBeCFWxvY2FsaG9zdC5sb2NhbGRvbWFpbjALggkxMjcuMC4wLjEw
118+
DYILZXhhbXBsZS5jb20wDYILZXhhbXBsZS5vcmcwDYILZXhhbXBsZS5uZXQwCgYI
119+
KoZIzj0EAwIDSQAwRgIhAMsdAe4bv6FNNkLSCn6AN0Tm4K5scFjqTGAAr1M7EfZm
120+
AiEAxghz2EV+6OlevltonhLpoo6VMQEdnpkEF9PzVHEbn6w=
121+
-----END CERTIFICATE-----
122+
123+
Certificate:
124+
Data:
125+
Version: 3 (0x2)
126+
Serial Number: 284423255585370380375410701638165198317432410917 (0x31d1fad9752ce503dbbacd0bf76abc930d651325)
127+
Signature Algorithm: sha256
128+
Issuer: commonName=CN=ca.example.com, O=Example CA, C=IT, organizationName=Example CA, countryName=IT
129+
Validity
130+
Not Before: May 27 09:13:33 2025 GMT
131+
Not After : May 28 09:13:33 2026 GMT
132+
Subject: commonName=CN=ca.example.com, O=Example CA, C=IT, organizationName=Example CA, countryName=IT
133+
Subject Public Key Info:
134+
Public Key Algorithm: id-ecPublicKey (EC)
135+
Public-Key: (256 bit)
136+
Curve: secp256r1
137+
X: 7607860515366991947250115130866123391572079251785604713950047686319787674406
138+
Y: 74493290682810963932331564302963289249956540428755890573822716633130571216251
139+
X509v3 extensions:
140+
X509v3 Basic Constraints:
141+
CA:TRUE, pathlen:2
142+
X509v3 Subject Alternative Name:
143+
DNS:ca.example.com
144+
X509v3 Key Usage:
145+
Digital Signature, Key Encipherment, Certificate Sign, CRL Sign
146+
X509v3 CRL Distribution Points:
147+
Full Name:
148+
URI:https://ca.example.com/crl/ca.example.com.crl
149+
X509v3 Name Constraints:
150+
Excluded:
151+
DNS.1=localhost
152+
DNS.2=localhost.localdomain
153+
DNS.3=127.0.0.1
154+
DNS.4=example.com
155+
DNS.5=example.org
156+
DNS.6=example.net
157+
158+
Signature Algorithm: sha256
159+
30:46:02:21:00:b9:6c:2c:6f:9a:18:b8:04:d6:39:d3
160+
50:dd:e6:a6:ce:9b:f0:d8:64:48:7b:4b:33:2e:fe:d9
161+
3d:13:81:4c:d4:02:21:00:ab:10:9d:f1:0f:64:d8:dc
162+
76:53:d1:e3:32:b1:65:b7:97:83:d7:69:0f:5a:da:9b
163+
1e:a4:a9:a3:88:98:6b:5f
164+
165+
-----BEGIN CERTIFICATE-----
166+
MIICmjCCAj+gAwIBAgIUMdH62XUs5QPbus0L92q8kw1lEyUwCgYIKoZIzj0EAwIw
167+
UjEuMCwGA1UEAwwlQ049Y2EuZXhhbXBsZS5jb20sIE89RXhhbXBsZSBDQSwgQz1J
168+
VDETMBEGA1UECgwKRXhhbXBsZSBDQTELMAkGA1UEBhMCSVQwHhcNMjUwNTI3MDkx
169+
MzMzWhcNMjYwNTI4MDkxMzMzWjBSMS4wLAYDVQQDDCVDTj1jYS5leGFtcGxlLmNv
170+
bSwgTz1FeGFtcGxlIENBLCBDPUlUMRMwEQYDVQQKDApFeGFtcGxlIENBMQswCQYD
171+
VQQGEwJJVDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABBDR5X4r9VUDnU5X2rIf
172+
xDo7DFNodgP2AD4jzqrETwsmpLG1V9s1bu+zyFrnGVvKmoqR0kOeZ1/vyN5vhMcx
173+
NXujgfIwge8wEgYDVR0TAQH/BAgwBgEB/wIBAjAZBgNVHREEEjAQgg5jYS5leGFt
174+
cGxlLmNvbTAOBgNVHQ8BAf8EBAMCAaYwPgYDVR0fBDcwNTAzoDGgL4YtaHR0cHM6
175+
Ly9jYS5leGFtcGxlLmNvbS9jcmwvY2EuZXhhbXBsZS5jb20uY3JsMG4GA1UdHgEB
176+
/wRkMGKhYDALgglsb2NhbGhvc3QwF4IVbG9jYWxob3N0LmxvY2FsZG9tYWluMAuC
177+
CTEyNy4wLjAuMTANggtleGFtcGxlLmNvbTANggtleGFtcGxlLm9yZzANggtleGFt
178+
cGxlLm5ldDAKBggqhkjOPQQDAgNJADBGAiEAuWwsb5oYuATWOdNQ3eamzpvw2GRI
179+
e0szLv7ZPROBTNQCIQCrEJ3xD2TY3HZT0eMysWW3l4PXaQ9a2psepKmjiJhrXw==
180+
-----END CERTIFICATE-----

0 commit comments

Comments
 (0)