packagecom;importjava.io.BufferedReader;importjava.io.File;importjava.io.FileInputStream;importjava.io.FileOutputStream;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.OutputStream;importjava.security.KeyStore;importjava.security.MessageDigest;importjava.security.cert.CertificateException;importjava.security.cert.X509Certificate;importjavax.net.ssl.SSLContext;importjavax.net.ssl.SSLException;importjavax.net.ssl.SSLSocket;importjavax.net.ssl.SSLSocketFactory;importjavax.net.ssl.TrustManager;importjavax.net.ssl.TrustManagerFactory;importjavax.net.ssl.X509TrustManager;/*** 从网站获取java所需的证书,调用时传入域名。*/
public classInstallCert {public static void main(String[] args) throwsException {
String host;intport;char[] passphrase;if ((args.length == 1) || (args.length == 2)) {
String[] c= args[0].split(":");
host= c[0];
port= (c.length =&