code: private static X509Certificate initCert(String path) {
  		X509Certificate encryptCertTemp = null;
  		CertificateFactory cf = null;
  		FileInputStream in = null;
  		try {
  			cf = CertificateFactory.getInstance("X.509", "BC");
  			in = new FileInputStream(path);
  			encryptCertTemp = (X509Certificate) cf.generateCertificate(in);
  			// 打印证书加载信息,供测试阶段调试
  			LogUtil.writeLog("[" + path + "][CertId="
  					+ encryptCertTemp.getSerialNumber().toString() + "]");
  		} catch (CertificateException e) {
  			LogUtil.writeErrorLog("InitCert Error", e);
  		} catch (FileNotFoundException e) {
  			LogUtil.writeErrorLog("InitCert Error File Not Found", e);
  		} catch (NoSuchProviderException e) {
  			LogUtil.writeErrorLog("LoadVerifyCert Error No BC Provider", e);
  		} finally {
  			if (null != in) {
  				try {
  					in.close();
  				} catch (IOException e) {
  					LogUtil.writeErrorLog(e.toString());
  				}
  			}
  		}
  		return encryptCertTemp;
  	}
docs: 通过证书路径初始化为公钥证书
  @param path
  @return