[Webfunds-commits] java/java/security/cert CertificateFactory.java

Edwin Woudt edwin@cypherpunks.ai
Mon, 7 Aug 2000 14:38:34 -0400 (AST)


edwin       00/08/07 14:38:34

  Modified:    java/security/cert CertificateFactory.java
  Log:
  Add OpenPGP certificates

Revision  Changes    Path
1.2       +9 -3      java/java/security/cert/CertificateFactory.java

Index: CertificateFactory.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/java/security/cert/CertificateFactory.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CertificateFactory.java	2000/07/21 21:29:57	1.1
+++ CertificateFactory.java	2000/08/07 18:38:34	1.2
@@ -9,14 +9,16 @@
 import java.io.InputStream;
 import java.security.Provider;
 
+import webfunds.openpgp.cert.SimpleOpenPGPCertificateFactorySpi;
 
+
 /**
  * Stripped down version of the JDK 1.2 CertificateFactory. The methods that
  * are present have the same signature as Sun's. The methods that were omitted
  * depend on JDK 1.2 features. This implementation is just sufficient to run
  * WebFunds on JDK 1.1.
  *
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
  * @author  Jeroen C. van Gelderen (gelderen@cryptix.org)
  */
 public class CertificateFactory
@@ -42,10 +44,14 @@
     public static final CertificateFactory getInstance(String type)
         throws CertificateException
     {
-        if( type.equals("X.509") )
+        if( type.equals("X.509") ) {
             return new CertificateFactory(
                 new CertificateFactorySpiX509(), null, "X.509" );
-        else
+        } else if( type.equals("OpenPGP") || type.equals("PGP") ) {
+            return new CertificateFactory(
+                new SimpleOpenPGPCertificateFactorySpi(), null, "OpenPGP" );
+        } else {
             throw new CertificateException("Unknown type: " + type);
+        }
     }
 }