code: protected static String opensslHash(X509Certificate cert) {
          try {
              return openssl_X509_NAME_hash(cert.getSubjectX500Principal());
          }
          catch (Exception e) {
              throw new Error("MD5 isn't available!", e);
          }
      }
docs: /*
  the following methods are based off code to compute the subject
  name hash from:
  http://blog.piefox.com/2008/10/javaopenssl-ca-generation.html