code: public static String nameHash(X500Principal subjectDN) {
          try {
              return hash(encodePrincipal(subjectDN));
          } catch (Exception e) {
              logger.error("", e);
              return null;
          }
      }
docs: Returns equivalent of:
  openssl x509 -in "cert-file" -hash -noout
  
  @param subjectDN
  @return hash for certificate names