code: public static java.security.cert.X509Certificate convert(javax.security.cert.X509Certificate cert) {
          try {
              byte[] encoded = cert.getEncoded();
              ByteArrayInputStream bis = new ByteArrayInputStream(encoded);
              java.security.cert.CertificateFactory cf
                  = java.security.cert.CertificateFactory.getInstance("X.509");
              return (java.security.cert.X509Certificate)cf.generateCertificate(bis);
          } catch (java.security.cert.CertificateEncodingException e) {
          } catch (javax.security.cert.CertificateEncodingException e) {
          } catch (java.security.cert.CertificateException e) {
          }
          return null;
      }
docs: Converts to java.security