48256
|
1 |
/*
|
|
2 |
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
* or visit www.oracle.com if you need additional information or have any
|
|
21 |
* questions.
|
|
22 |
*/
|
|
23 |
|
|
24 |
/*
|
|
25 |
* @test
|
|
26 |
* @bug 8189131
|
|
27 |
* @summary Interoperability tests with "D-Trust Root Class 3 CA 2 2009" and
|
|
28 |
* "D-Trust Root Class 3 CA 2 EV 2009" CAs
|
|
29 |
* @build ValidatePathWithParams
|
|
30 |
* @run main/othervm -Djava.security.debug=certpath DTrustCA OCSP
|
|
31 |
* @run main/othervm -Djava.security.debug=certpath DTrustCA CRL
|
|
32 |
*/
|
|
33 |
public class DTrustCA {
|
|
34 |
|
|
35 |
public static void main(String[] args) throws Exception {
|
|
36 |
|
|
37 |
ValidatePathWithParams pathValidator = new ValidatePathWithParams(null);
|
|
38 |
|
|
39 |
boolean ocspEnabled = true;
|
|
40 |
|
|
41 |
if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) {
|
|
42 |
pathValidator.enableCRLCheck();
|
|
43 |
ocspEnabled = false;
|
|
44 |
} else {
|
|
45 |
// OCSP check by default
|
|
46 |
pathValidator.enableOCSPCheck();
|
|
47 |
}
|
|
48 |
|
|
49 |
new RootClass3CA2().runTest(pathValidator, ocspEnabled);
|
|
50 |
new RootClass3CA2EV().runTest(pathValidator, ocspEnabled);
|
|
51 |
}
|
|
52 |
}
|
|
53 |
|
|
54 |
class RootClass3CA2 {
|
|
55 |
|
|
56 |
// Owner: CN=D-TRUST SSL Class 3 CA 1 2009, O=D-Trust GmbH, C=DE
|
|
57 |
private static final String INT = "-----BEGIN CERTIFICATE-----\n"
|
|
58 |
+ "MIIFMjCCBBqgAwIBAgIDCZBjMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF\n"
|
|
59 |
+ "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD\n"
|
|
60 |
+ "bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMTIxMjQ2NTVaFw0yOTExMDUwODM1NTha\n"
|
|
61 |
+ "MEwxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJjAkBgNVBAMM\n"
|
|
62 |
+ "HUQtVFJVU1QgU1NMIENsYXNzIDMgQ0EgMSAyMDA5MIIBIjANBgkqhkiG9w0BAQEF\n"
|
|
63 |
+ "AAOCAQ8AMIIBCgKCAQEAoal0SyLSijE0JkuhHJmOCbmQznyxuSY7DaEwhUsdUpI+\n"
|
|
64 |
+ "2llkDLz6s9BWQe1zCVXDhrt3qz5U5H4h6jxm5Ec+ZbFiU3Gv2yxpI5cRPrqj9mJU\n"
|
|
65 |
+ "1CGgy1+29khuUnoopzSq66HPuGZGh06I7bJkXTQ7AQ92z1MdL2wATj1UWdNid3sQ\n"
|
|
66 |
+ "NiWIm+69nURHY6tmCNenNcG6aV4qjHMUPsjpCRabNY9nUO12rsmiDW2mbAC3gcxQ\n"
|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YJKoZIhvcNAQELBQADggEBABM5QRHX/yInsmZLWVlvmWmKb3c4IB3hAIVR\n"
|
|
81 |
+ "sAGhkvQJ/RD1GZjZUBBYMWkD1P37fTQxlqTOe3NecVvElkYZuCq7HSM6o7awzb3m\n"
|
|
82 |
+ "yLn1kN+hDCsxX0EYbVSNjEjkW3QEkqJH9owH4qeMDxf7tfXB7BVKO+rarYPa2PR8\n"
|
|
83 |
+ "Wz2KhjFDmAeFg2J89YcpeJJEEJXoweAkgJEEwwEIfJ2yLjYo78RD0Rvij/+zkfj9\n"
|
|
84 |
+ "+dSvTiZTuqicyo37qNoYHgchuqXnKodhWkW89oo2NKhfeNHHbqvXEJmx0PbI6YyQ\n"
|
|
85 |
+ "50GnYECZRHNKhgbPEtNy/QetU53aWlTlvu4NIwLW5XVsrxlQ2Zw=\n"
|
|
86 |
+ "-----END CERTIFICATE-----";
|
|
87 |
|
|
88 |
// Owner: CN=certdemo-ov-valid.ssl.d-trust.net, O=D-Trust GmbH, OU=IT,
|
|
89 |
// L=Berlin, ST=Berlin, C=DE, SERIALNUMBER=DTRWS354803406304201, DNQ=7223150018
|
|
90 |
private static final String VALID = "-----BEGIN CERTIFICATE-----\n"
|
|
91 |
+ "MIIF1jCCBL6gAwIBAgIDD07RMA0GCSqGSIb3DQEBCwUAMEwxCzAJBgNVBAYTAkRF\n"
|
|
92 |
+ "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJjAkBgNVBAMMHUQtVFJVU1QgU1NMIENs\n"
|
|
93 |
+ "YXNzIDMgQ0EgMSAyMDA5MB4XDTEyMTIxMTEwMTgzN1oXDTE1MTIyMTExMTgwOVow\n"
|
|
94 |
+ "gbMxEzARBgNVBC4TCjcyMjMxNTAwMTgxHTAbBgNVBAUTFERUUldTMzU0ODAzNDA2\n"
|
|
95 |
+ "MzA0MjAxMQswCQYDVQQGEwJERTEPMA0GA1UECAwGQmVybGluMQ8wDQYDVQQHDAZC\n"
|
|
96 |
+ "ZXJsaW4xCzAJ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certdemo-ov-revoked.ssl.d-trust.net, O=D-Trust GmbH, OU=IT,
|
|
126 |
// L=Berlin, ST=Berlin, C=DE, DNQ=5562882417
|
|
127 |
private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
|
|
128 |
+ "MIIFuzCCBKOgAwIBAgIDExFnMA0GCSqGSIb3DQEBCwUAMEwxCzAJBgNVBAYTAkRF\n"
|
|
129 |
+ "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJjAkBgNVBAMMHUQtVFJVU1QgU1NMIENs\n"
|
|
130 |
+ "YXNzIDMgQ0EgMSAyMDA5MB4XDTE0MDYyNjE2MTg1NloXDTE1MDYyOTE2MTg1Nlow\n"
|
|
131 |
+ "gZYxEzARBgNVBC4TCjU1NjI4ODI0MTcxCzAJBgNVBAYTAkRFMQ8wDQYDVQQIEwZC\n"
|
|
132 |
+ "ZXJsaW4xDzANBgNVBAcTBkJlcmxpbjELMAkGA1UECxMCSVQxFTATBgNVBAoTDEQt\n"
|
|
133 |
+ "VHJ1c3QgR21iSDEsMCoGA1UEAxMjY2VydGRlbW8tb3YtcmV2b2tlZC5zc2wuZC10\n"
|
|
134 |
+ "cnVzdC5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtdH2wqHgG\n"
|
|
135 |
+ "tqlekrfRQzJuhMzRllfYcmmsxr7jsnwgPe0+zib+GeTDm9U5+XKjT1uYETL501ov\n"
|
|
136 |
+ "HfKsZ/aK+k58iFF5evEtdHic/2v868uwxcm/Kcn+zt2uX9QvfSUzJPQkW/Ynu3w2\n"
|
|
137 |
+ "IhuBNBlFAJgxjYr2xMUmDrVDx1/ZfBc0ddyo87MccLZOdmqLhef8bJQ+3q6DA+Z1\n"
|
|
138 |
+ "bGk1wHl9KgFNtOjlKws5nKzCzyugy+MhLo+4wPxi0UhUA7QA7fk7lWBwJ9fZRTT/\n"
|
|
139 |
+ "cKfP4lUucXdQBS2ZhvpEZggjjBDhTHtZLwdfEUlf1GZ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gkq\n"
|
|
153 |
+ "hkiG9w0BAQsFAAOCAQEAO3sbXee7GbEyXSRZOgwk2LloPNIFriFGP8WAWnsaf056\n"
|
|
154 |
+ "jxHRnjjPQRyqhBmGQAGwrEp3a3uF+6gbM2XuoKPjNFqjqnQNR2+lVRs8pVTTjJ+r\n"
|
|
155 |
+ "SekcOUbCx6nIe98OBheAljAxfeal3e8bBrP3VA+QvOscaLJiC1ZsGfqvrGYJDt6b\n"
|
|
156 |
+ "UFMKbNuwDcfpKkrB0AyW0NvYALwgTPr+SgbxB0Xrp0W+dg6XfHmpuRSSPUkZqzEY\n"
|
|
157 |
+ "uPTmIgs7qCtVEIpV91gDFBDNfr4QbFVCNvDmMIZNMnXUEmTW81N1KUVTNdz8k5TY\n"
|
|
158 |
+ "HO/7TeeAi2u0m3ERrLXE9SKtNwUMJujEOQ/UmQkIQw==\n"
|
|
159 |
+ "-----END CERTIFICATE-----";
|
|
160 |
|
|
161 |
public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled)
|
|
162 |
throws Exception {
|
|
163 |
// Validate valid
|
|
164 |
pathValidator.validate(new String[]{VALID, INT},
|
|
165 |
ValidatePathWithParams.Status.GOOD, null, System.out);
|
|
166 |
|
|
167 |
// Validate Revoked
|
|
168 |
if (ocspEnabled) {
|
|
169 |
// Test certificates are expired in 2015
|
|
170 |
// and backdated revocation check is only possible with OCSP
|
|
171 |
pathValidator.setValidationDate("Jan 01, 2015");
|
|
172 |
}
|
|
173 |
|
|
174 |
pathValidator.validate(new String[]{REVOKED, INT},
|
|
175 |
ValidatePathWithParams.Status.REVOKED,
|
|
176 |
"Thu Jun 26 09:28:39 PDT 2014", System.out);
|
|
177 |
|
|
178 |
// reset validation date back to current date
|
|
179 |
pathValidator.resetValidationDate();
|
|
180 |
}
|
|
181 |
}
|
|
182 |
|
|
183 |
class RootClass3CA2EV {
|
|
184 |
|
|
185 |
// Owner: CN=D-TRUST SSL Class 3 CA 1 EV 2009, O=D-Trust GmbH, C=DE
|
|
186 |
private static final String INT = "-----BEGIN CERTIFICATE-----\n"
|
|
187 |
+ "MIIFRTCCBC2gAwIBAgIDCZBkMA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF\n"
|
|
188 |
+ "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD\n"
|
|
189 |
+ "bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMTIxMjUyNDNaFw0yOTExMDUwODUw\n"
|
|
190 |
+ "NDZaME8xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKTAnBgNV\n"
|
|
191 |
+ "BAMMIEQtVFJVU1QgU1NMIENsYXNzIDMgQ0EgMSBFViAyMDA5MIIBIjANBgkqhkiG\n"
|
|
192 |
+ "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAygp+ZziakFyPq80fk1QIT9UCcPy0R3UIyq56\n"
|
|
193 |
+ "hXA6lhgfs1l9R9wRM9/DIVX2olb0gHCXdpnHRm+jwzeL3dHJO8Im5Om/c24ZfSVE\n"
|
|
194 |
+ "zBcgKxS5X7X5e7oCYb9tozd9xs04WqYd5kWrvCJsSQf5gtv5gAeJt+QiU7dtXs3A\n"
|
|
195 |
+ "YDflWv4g9eEaDExxM0VQmceEAo5qc7I7dk5ry356G14zQmr29cxie6YS0kH+7qn5\n"
|
|
196 |
+ "g+c21M01sENle0tBPxIfkv+nV95Ih3JkpHSPm/wgFKfCtwRtG+5VehUoMEpgfi0X\n"
|
|
197 |
+ "fmVkag558aQpaaeQCtYZnXuq6g1D1LAcjIqMpOP4wNRp1ldLzQIDAQABo4ICJzCC\n"
|
|
198 |
+ "AiMwHwYDVR0jBBgwFoAU05SKTGITKhkuzK9yin0215oc3GcwRwYIKwYBBQUHAQEE\n"
|
|
199 |
+ "OzA5MDcGCCsGAQUFBzABhitodHRwOi8vcm9vdC1jMy1jYTItZXYtMjAwOS5vY3Nw\n"
|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G2XnbckxFKUxa7uEroZcMwvKBy469K0Au0zVTxs1zNtf\n"
|
|
214 |
+ "Ol3QkNgPwzOPeHhOnpzcenyPgNEm+HQ0FPTnB4HeKBqTeLpkM7h4gq5MZ2TPmfuX\n"
|
|
215 |
+ "KDz3AHrWLLdH\n"
|
|
216 |
+ "-----END CERTIFICATE-----";
|
|
217 |
|
|
218 |
// Owner: CN=certdemo-ev-revoked.ssl.d-trust.net, O=D-Trust GmbH, OU=IT,
|
|
219 |
// STREET=Berlin, OID.2.5.4.17=10969, L=Berlin, ST=Berlin, C=DE,
|
|
220 |
// SERIALNUMBER=HRB74346, OID.2.5.4.15=Private Organization,
|
|
221 |
// OID.1.3.6.1.4.1.311.60.2.1.1=Berlin, OID.1.3.6.1.4.1.311.60.2.1.2=Berlin,
|
|
222 |
// OID.1.3.6.1.4.1.311.60.2.1.3=DE, DNQ=4028175542
|
|
223 |
private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n"
|
|
224 |
+ "MIIGZDCCBUygAwIBAgIDExFtMA0GCSqGSIb3DQEBCwUAME8xCzAJBgNVBAYTAkRF\n"
|
|
225 |
+ "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKTAnBgNVBAMMIEQtVFJVU1QgU1NMIENs\n"
|
|
226 |
+ "YXNzIDMgQ0EgMSBFViAyMDA5MB4XDTE0MDYyNjE2NDMyOFoXDTE1MDYyOTE2NDMy\n"
|
|
227 |
+ "OFowggEwMRMwEQYDVQQuEwo0MDI4MTc1NTQyMRMwEQYLKwYBBAGCNzwCAQMMAkRF\n"
|
|
228 |
+ "MRcwFQYLKwYBBAGCNzwCAQIMBkJlcmxpbjEXMBUGCysGAQQBgjc8AgEBDAZCZXJs\n"
|
|
229 |
+ "aW4xHTAbBgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMREwDwYDVQQFEwhIUkI3\n"
|
|
230 |
+ "NDM0NjELMAkGA1UEBhMCREUxDzANBgNVBAgTBkJlcmxpbjEPMA0GA1UEB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gccwsQCFMrVjIo6HR\n"
|
|
258 |
+ "qiZC9Z+23vM=\n"
|
|
259 |
+ "-----END CERTIFICATE-----";
|
|
260 |
|
|
261 |
public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled)
|
|
262 |
throws Exception {
|
|
263 |
// Validate valid
|
|
264 |
// Valid cert received as test artifact was revoked so remove test
|
|
265 |
|
|
266 |
// Validate Revoked
|
|
267 |
if (ocspEnabled) {
|
|
268 |
// Revoked certificates are expired in 2015
|
|
269 |
// and backdated revocation check is only possible with OCSP
|
|
270 |
pathValidator.setValidationDate("Jan 01, 2015");
|
|
271 |
}
|
|
272 |
|
|
273 |
pathValidator.validate(new String[]{REVOKED, INT},
|
|
274 |
ValidatePathWithParams.Status.REVOKED,
|
|
275 |
"Thu Jun 26 09:45:14 PDT 2014", System.out);
|
|
276 |
|
|
277 |
// reset validation date back to current date
|
|
278 |
pathValidator.resetValidationDate();
|
|
279 |
}
|
|
280 |
}
|