test/jdk/lib/security/cacerts/VerifyCACerts.java
changeset 50529 efd199ab8322
parent 50334 928a93482dd7
child 50541 cf88c15d9171
equal deleted inserted replaced
50528:1fd4844371bb 50529:efd199ab8322
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 /**
    25 /**
    26  * @test
    26  * @test
    27  * @bug 8189131 8198240 8191844 8189949 8191031
    27  * @bug 8189131 8198240 8191844 8189949 8191031 8196141
    28  * @requires java.runtime.name ~= "OpenJDK.*"
    28  * @requires java.runtime.name ~= "OpenJDK.*"
    29  * @summary Check root CA entries in cacerts file
    29  * @summary Check root CA entries in cacerts file
    30  */
    30  */
    31 import java.io.File;
    31 import java.io.File;
    32 import java.io.FileInputStream;
    32 import java.io.FileInputStream;
    40     private static final String CACERTS
    40     private static final String CACERTS
    41             = System.getProperty("java.home") + File.separator + "lib"
    41             = System.getProperty("java.home") + File.separator + "lib"
    42             + File.separator + "security" + File.separator + "cacerts";
    42             + File.separator + "security" + File.separator + "cacerts";
    43 
    43 
    44     // The numbers of certs now.
    44     // The numbers of certs now.
    45     private static final int COUNT = 70;
    45     private static final int COUNT = 74;
    46 
    46 
    47     // map of cert alias to SHA-256 fingerprint
    47     // map of cert alias to SHA-256 fingerprint
    48     private static final Map<String, String> FINGERPRINT_MAP
    48     private static final Map<String, String> FINGERPRINT_MAP
    49             = new HashMap<String, String>() {
    49             = new HashMap<String, String>() {
    50         {
    50         {
   186                     "79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27");
   186                     "79:08:B4:03:14:C1:38:10:0B:51:8D:07:35:80:7F:FB:FC:F8:51:8A:00:95:33:71:05:BA:38:6B:15:3D:D9:27");
   187             put("securetrustca [jdk]",
   187             put("securetrustca [jdk]",
   188                     "F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73");
   188                     "F1:C1:B5:0A:E5:A2:0D:D8:03:0E:C9:F6:BC:24:82:3D:D3:67:B5:25:57:59:B4:E7:1B:61:FC:E9:F7:37:5D:73");
   189             put("xrampglobalca [jdk]",
   189             put("xrampglobalca [jdk]",
   190                     "CE:CD:DC:90:50:99:D8:DA:DF:C5:B1:D2:09:B7:37:CB:E2:C1:8C:FB:2C:10:C0:FF:0B:CF:0D:32:86:FC:1A:A2");
   190                     "CE:CD:DC:90:50:99:D8:DA:DF:C5:B1:D2:09:B7:37:CB:E2:C1:8C:FB:2C:10:C0:FF:0B:CF:0D:32:86:FC:1A:A2");
       
   191             put("godaddyrootg2ca [jdk]",
       
   192                     "45:14:0B:32:47:EB:9C:C8:C5:B4:F0:D7:B5:30:91:F7:32:92:08:9E:6E:5A:63:E2:74:9D:D3:AC:A9:19:8E:DA");
       
   193             put("godaddyclass2ca [jdk]",
       
   194                     "C3:84:6B:F2:4B:9E:93:CA:64:27:4C:0E:C6:7C:1E:CC:5E:02:4F:FC:AC:D2:D7:40:19:35:0E:81:FE:54:6A:E4");
       
   195             put("starfieldclass2ca [jdk]",
       
   196                     "14:65:FA:20:53:97:B8:76:FA:A6:F0:A9:95:8E:55:90:E4:0F:CC:7F:AA:4F:B7:C2:C8:67:75:21:FB:5F:B6:58");
       
   197             put("starfieldrootg2ca [jdk]",
       
   198                     "2C:E1:CB:0B:F9:D2:F9:E1:02:99:3F:BE:21:51:52:C3:B2:DD:0C:AB:DE:1C:68:E5:31:9B:83:91:54:DB:B7:F5");
   191         }
   199         }
   192     };
   200     };
   193 
   201 
   194     // Exception list to 90 days expiry policy
   202     // Exception list to 90 days expiry policy
   195     private static final HashSet<String> EXPIRY_EXC_ENTRIES
   203     private static final HashSet<String> EXPIRY_EXC_ENTRIES