我对Java比较陌生,偶然发现了用于CA证书绕过的代码片段。在为TrustManager []和X509TrustManager()更新之后,我无法理解花括号。有人能解开一些光吗?谢谢。
TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(X509Certificate[] certs, String authType) {
}
}
};