public static X509CertImpl toImpl(X509Certificate cert) throws CertificateException {
  if (cert instanceof X509CertImpl) {
    return (X509CertImpl)cert;
  }
 else {
    return X509Factory.intern(cert);
  }
}

public static X509CertImpl toImpl ( X509Certificate cert ) throws CertificateException { if ( cert instanceof X509CertImpl ) { return ( X509CertImpl ) cert ; } else { return X509Factory . intern ( cert ) ; } }
utility method to convert an arbitrary instance of x509certificate to a x509certimpl . does a cast if possible , otherwise reparses the encoding .
