Code example for CertificateFactory

Methods: generateCertificate

0
  { 
    try 
      { 
        ByteArrayInputStream in =
          new ByteArrayInputStream(encoded.getBytes("UTF-8"));
        return (X509Certificate) factory.generateCertificate(in);
      } 
    catch (Exception x)
      { 
        return null; 
      } 
  } 
 
  // Instance methods. 
  // ------------------------------------------------------------------------- 
 
  public X509Certificate[] getCertificates()
  { 
    return (X509Certificate[]) certs.clone();
  }