code: public static TBSCertificateStructure getTBSCertificateStructure(
              X509Certificate cert)
              throws CertificateEncodingException, IOException {
          ASN1Primitive obj = toASN1Primitive(cert.getTBSCertificate());
          return TBSCertificateStructure.getInstance(obj);
      }
docs: Extracts the TBS certificate from the given certificate.
  
  @param cert the X.509 certificate to extract the TBS certificate from.
  @return the TBS certificate
  @throws IOException                  if extraction fails.
  @throws CertificateEncodingException if extraction fails.