/[classpath]/classpath/gnu/java/security/provider/X509CertificateFactory.java
ViewVC logotype

Diff of /classpath/gnu/java/security/provider/X509CertificateFactory.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by rsdio, Wed Apr 23 22:59:42 2003 UTC revision 1.1.2.1 by gnu_andrew, Sun Jan 16 02:14:46 2005 UTC
# Line 7  GNU Classpath is free software; you can Line 7  GNU Classpath is free software; you can
7  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)  the Free Software Foundation; either version 2, or (at your option)
9  any later version.  any later version.
10    
11  GNU Classpath is distributed in the hope that it will be useful, but  GNU Classpath is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Line 44  import java.io.InputStream; Line 44  import java.io.InputStream;
44  import java.io.IOException;  import java.io.IOException;
45    
46  import java.security.cert.Certificate;  import java.security.cert.Certificate;
47    import java.security.cert.CertificateEncodingException;
48  import java.security.cert.CertificateException;  import java.security.cert.CertificateException;
49  import java.security.cert.CertificateFactorySpi;  import java.security.cert.CertificateFactorySpi;
50    import java.security.cert.CertPath;
51  import java.security.cert.CRL;  import java.security.cert.CRL;
52  import java.security.cert.CRLException;  import java.security.cert.CRLException;
53    
54  import java.util.Collection;  import java.util.Collection;
55    import java.util.Iterator;
56  import java.util.LinkedList;  import java.util.LinkedList;
57    import java.util.List;
58    
59  import gnu.java.io.Base64InputStream;  import gnu.java.io.Base64InputStream;
60  import gnu.java.security.x509.X509Certificate;  import gnu.java.security.x509.X509Certificate;
61    import gnu.java.security.x509.X509CertPath;
62  import gnu.java.security.x509.X509CRL;  import gnu.java.security.x509.X509CRL;
63    
64  public class X509CertificateFactory extends CertificateFactorySpi  public class X509CertificateFactory extends CertificateFactorySpi
# Line 87  public class X509CertificateFactory exte Line 92  public class X509CertificateFactory exte
92        }        }
93      catch (IOException ioe)      catch (IOException ioe)
94        {        {
95          throw new CertificateException(ioe.toString());          CertificateException ce = new CertificateException(ioe.getMessage());
96            ce.initCause (ioe);
97            throw ce;
98        }        }
99    }    }
100    
# Line 107  public class X509CertificateFactory exte Line 114  public class X509CertificateFactory exte
114            }            }
115          catch (IOException ioe)          catch (IOException ioe)
116            {            {
117              throw new CertificateException(ioe.toString());              CertificateException ce = new CertificateException(ioe.getMessage());
118                ce.initCause (ioe);
119                throw ce;
120            }            }
121        }        }
122      return certs;      return certs;
# Line 121  public class X509CertificateFactory exte Line 130  public class X509CertificateFactory exte
130        }        }
131      catch (IOException ioe)      catch (IOException ioe)
132        {        {
133          throw new CRLException(ioe.toString());          CRLException crle = new CRLException(ioe.getMessage());
134            crle.initCause (ioe);
135            throw crle;
136        }        }
137    }    }
138    
# Line 141  public class X509CertificateFactory exte Line 152  public class X509CertificateFactory exte
152            }            }
153          catch (IOException ioe)          catch (IOException ioe)
154            {            {
155              throw new CRLException(ioe.toString());              CRLException crle = new CRLException(ioe.getMessage());
156                crle.initCause (ioe);
157                throw crle;
158            }            }
159        }        }
160      return crls;      return crls;
161    }    }
162    
163      public CertPath engineGenerateCertPath(List certs)
164      {
165        return new X509CertPath(certs);
166      }
167    
168      public CertPath engineGenerateCertPath(InputStream in)
169        throws CertificateEncodingException
170      {
171        return new X509CertPath(in);
172      }
173    
174      public CertPath engineGenerateCertPath(InputStream in, String encoding)
175        throws CertificateEncodingException
176      {
177        return new X509CertPath(in, encoding);
178      }
179    
180      public Iterator engineGetCertPathEncodings()
181      {
182        return X509CertPath.ENCODINGS.iterator();
183      }
184    
185    // Own methods.    // Own methods.
186    // ------------------------------------------------------------------------    // ------------------------------------------------------------------------
187    
188    private X509Certificate generateCert(InputStream inStream)    private X509Certificate generateCert(InputStream inStream)
189      throws IOException, CertificateException      throws IOException, CertificateException
190    {    {
191        if (inStream == null)
192          throw new CertificateException("missing input stream");
193      if (!inStream.markSupported())      if (!inStream.markSupported())
194        inStream = new BufferedInputStream(inStream, 8192);        inStream = new BufferedInputStream(inStream, 8192);
195      inStream.mark(20);      inStream.mark(20);
# Line 211  public class X509CertificateFactory exte Line 248  public class X509CertificateFactory exte
248    private X509CRL generateCRL(InputStream inStream)    private X509CRL generateCRL(InputStream inStream)
249      throws IOException, CRLException      throws IOException, CRLException
250    {    {
251        if (inStream == null)
252          throw new CRLException("missing input stream");
253      if (!inStream.markSupported())      if (!inStream.markSupported())
254        inStream = new BufferedInputStream(inStream, 8192);        inStream = new BufferedInputStream(inStream, 8192);
255      inStream.mark(20);      inStream.mark(20);
# Line 265  public class X509CertificateFactory exte Line 304  public class X509CertificateFactory exte
304          return new X509CRL(inStream);          return new X509CRL(inStream);
305        }        }
306    }    }
   
307  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26