提交 1bec85d0 编写于 作者: C clanger

8223555: Cleanups in cacerts tests

Reviewed-by: xuelei
上级 e1e6e063
/* /*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -253,7 +253,7 @@ public class ValidatePathWithParams { ...@@ -253,7 +253,7 @@ public class ValidatePathWithParams {
} }
// Generate CertPath with certsToValidate // Generate CertPath with certsToValidate
ArrayList<X509Certificate> certs = new ArrayList(); ArrayList<X509Certificate> certs = new ArrayList<>();
for (String cert : certsToValidate) { for (String cert : certsToValidate) {
if (cert != null) { if (cert != null) {
certs.add(getCertificate(cert)); certs.add(getCertificate(cert));
......
...@@ -32,8 +32,15 @@ import java.io.File; ...@@ -32,8 +32,15 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.security.KeyStore; import java.security.KeyStore;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.cert.*; import java.security.cert.Certificate;
import java.util.*; import java.security.cert.CertificateExpiredException;
import java.security.cert.CertificateNotYetValidException;
import java.security.cert.X509Certificate;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
public class VerifyCACerts { public class VerifyCACerts {
...@@ -45,8 +52,8 @@ public class VerifyCACerts { ...@@ -45,8 +52,8 @@ public class VerifyCACerts {
private static final int COUNT = 92; private static final int COUNT = 92;
// map of cert alias to SHA-256 fingerprint // map of cert alias to SHA-256 fingerprint
private static final Map<String, String> FINGERPRINT_MAP @SuppressWarnings("serial")
= new HashMap<String, String>() { private static final Map<String, String> FINGERPRINT_MAP = new HashMap<>() {
{ {
put("actalisauthenticationrootca [jdk]", put("actalisauthenticationrootca [jdk]",
"55:92:60:84:EC:96:3A:64:B9:6E:2A:BE:01:CE:0B:A8:6A:64:FB:FE:BC:C7:AA:B5:AF:C1:55:B3:7F:D7:60:66"); "55:92:60:84:EC:96:3A:64:B9:6E:2A:BE:01:CE:0B:A8:6A:64:FB:FE:BC:C7:AA:B5:AF:C1:55:B3:7F:D7:60:66");
...@@ -237,6 +244,7 @@ public class VerifyCACerts { ...@@ -237,6 +244,7 @@ public class VerifyCACerts {
// Exception list to 90 days expiry policy // Exception list to 90 days expiry policy
// No error will be reported if certificate in this list expires // No error will be reported if certificate in this list expires
@SuppressWarnings("serial")
private static final HashSet<String> EXPIRY_EXC_ENTRIES = new HashSet<>() { private static final HashSet<String> EXPIRY_EXC_ENTRIES = new HashSet<>() {
{ {
// Valid until: Sat Jul 06 19:59:59 EDT 2019 // Valid until: Sat Jul 06 19:59:59 EDT 2019
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册