code: public static X500Principal getSubjectX500Principal(X509Certificate cert) {
          try {
              return getX500Principal(cert, false);
          } catch (Exception e) {
              throw new RuntimeException("Could not parse subject", e);
          }
      }
docs: Extract the subject X500Principal from an X509Certificate.
  Called from java.security.cert.X509Certificate.getSubjectX500Principal().