jdk/test/java/security/cert/CertPathValidator/nameConstraintsRFC822/ValidateCertPath.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 4684810 |
26 * @bug 4684810 6994717 |
27 * @summary Verify that RFC822 name constraints are checked correctly |
27 * @summary Verify that RFC822 name constraints are checked correctly |
28 */ |
28 */ |
29 |
29 |
30 import java.io.ByteArrayOutputStream; |
30 import java.io.ByteArrayOutputStream; |
31 import java.io.File; |
31 import java.io.File; |
36 import java.security.cert.*; |
36 import java.security.cert.*; |
37 import java.security.cert.PKIXReason; |
37 import java.security.cert.PKIXReason; |
38 |
38 |
39 import java.util.ArrayList; |
39 import java.util.ArrayList; |
40 import java.util.Collections; |
40 import java.util.Collections; |
|
41 import java.util.Date; |
41 import java.util.List; |
42 import java.util.List; |
42 import java.util.Set; |
43 import java.util.Set; |
43 |
44 |
44 /** |
45 /** |
45 * ValidateCertPath performs a simple validation of a certification path. |
46 * ValidateCertPath performs a simple validation of a certification path. |
98 path = cf.generateCertPath(list); |
99 path = cf.generateCertPath(list); |
99 |
100 |
100 Set<TrustAnchor> anchors = Collections.singleton(anchor); |
101 Set<TrustAnchor> anchors = Collections.singleton(anchor); |
101 params = new PKIXParameters(anchors); |
102 params = new PKIXParameters(anchors); |
102 params.setRevocationEnabled(false); |
103 params.setRevocationEnabled(false); |
|
104 // The certificates expired on 10/22/10, so set the validity date to |
|
105 // 05/01/2009 to avoid expiration failures |
|
106 params.setDate(new Date(1243828800000l)); |
103 } |
107 } |
104 |
108 |
105 /* |
109 /* |
106 * Reads the entire input stream into a byte array. |
110 * Reads the entire input stream into a byte array. |
107 */ |
111 */ |