code: public static String toGlobusID(Principal name) {
          if (name instanceof X509Name) {
              return X509NameHelper.toString((X509Name)name);
          } else if (name instanceof X500Principal) {
              return CertificateUtil.toGlobusID((X500Principal) name);
          } else {
              return CertificateUtil.toGlobusID(name.getName());
          }
      }
docs: Converts the specified principal into Globus format.
  If the principal is of unrecognized type a simple string-based
  conversion is made using the {@link #toGlobusID(String) toGlobusID()}
  function.
  
  @see #toGlobusID(String)
  
  @param name the principal to convert to Globus format.
  @return the converted DN in Globus format.