private static CertificateFactory createFactory() {
    try {
      return CertificateFactory.getInstance(X509);
    }
    catch (CertificateException e) {
      throw new RuntimeException("Can't initialize X.509 certificate factory", e);
    }
  }
private static CertificateFactory createFactory()