code: public static GSIConstants.CertificateType getCertificateType(X509Certificate cert)
      throws CertificateException {
      try {
          TBSCertificateStructure crt = getTBSCertificateStructure(cert);
          return getCertificateType(crt);
      } catch (IOException e) {
          // but this should not happen
          throw new CertificateException("", e);
      }
      }
docs: Returns certificate type of the given certificate.
  Please see {@link #getCertificateType(TBSCertificateStructure)
  getCertificateType} for details for determining the certificate type.
  
  @param cert the certificate to get the type of.
  @return the certificate type as determined by
  {@link #getCertificateType(TBSCertificateStructure)
  getCertificateType}.
  @exception CertificateException if something goes wrong.