diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index cbafeb92bc6c702a7385c3828442ef4bf7a34102..bc37c8a4bfc9eccbaaa6858134e549b574dadde0 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,44 @@
+2000-03-09  Warren Levy  <warrenl@cygnus.com>
+
+	* java/security/AlgorithmParameterGeneratorSpi.java: New file.
+	* java/security/DigestException.java: New file.
+	* java/security/GeneralSecurityException.java: New file.
+	* java/security/InvalidAlgorithmParameterException.java: New file.
+	* java/security/InvalidKeyException.java: New file.
+	* java/security/InvalidParameterException.java: New file.
+	* java/security/Key.java: New file.
+	* java/security/KeyException.java: New file.
+	* java/security/KeyPair.java: New file.
+	* java/security/KeyPairGenerator.java: New file.
+	* java/security/KeyPairGeneratorSpi.java: New file.
+	* java/security/NoSuchProviderException.java: New file.
+	* java/security/PrivateKey.java: New file.
+	* java/security/Provider.java: New file.
+	* java/security/PublicKey.java: New file.
+	* java/security/SecureRandom.java: New file.
+	* java/security/Security.java: New file.
+	* java/security/Signature.java: New file.
+	* java/security/SignatureException.java: New file.
+	* java/security/interfaces/DSAKey.java: New file.
+	* java/security/interfaces/DSAParams.java: New file.
+	* java/security/interfaces/DSAPrivateKey.java: New file.
+	* java/security/interfaces/DSAPublicKey.java: New file.
+	* java/security/interfaces/RSAPrivateCrtKey.java: New file.
+	* java/security/interfaces/RSAPrivateKey.java: New file.
+	* java/security/interfaces/RSAPublicKey.java: New file.
+	* java/security/spec/AlgorithmParameterSpec.java: New file.
+	* java/security/spec/InvalidKeySpecException.java: New file.
+	* java/security/spec/InvalidParameterSpecException.java: New file.
+	* java/security/spec/KeySpec.java: New file.
+	* java/security/spec/RSAPrivateCrtKeySpec.java: New file.
+	* java/security/spec/RSAPrivateKeySpec.java: New file.
+	* java/security/spec/RSAPublicKeySpec.java: New file.
+	* Makefile.am: Added above java.security files.
+	* Makefile.in: Rebuilt.
+
+	* java/security/MessageDigest.java: Rewritten.
+	* java/security/SecureClassLoader.java: Added JDK1.2 comment.
+
 2000-03-09  Bryce McKinlay  <bryce@albatross.co.nz>
 
 	* README: Updated.
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 7711ec8e1a7f69e26ec65e4ced2c3ae7ecc586fe..1926f7d367dc812438ac3671aab9551dc0e65175 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -702,9 +702,42 @@ java/net/URLStreamHandler.java \
 java/net/URLStreamHandlerFactory.java \
 java/net/UnknownHostException.java \
 java/net/UnknownServiceException.java \
+java/security/AlgorithmParameterGeneratorSpi.java \
+java/security/DigestException.java \
+java/security/GeneralSecurityException.java \
+java/security/InvalidAlgorithmParameterException.java \
+java/security/InvalidKeyException.java \
+java/security/InvalidParameterException.java \
+java/security/Key.java \
+java/security/KeyException.java \
+java/security/KeyPair.java \
+java/security/KeyPairGenerator.java \
+java/security/KeyPairGeneratorSpi.java \
 java/security/MessageDigest.java \
 java/security/NoSuchAlgorithmException.java \
+java/security/NoSuchProviderException.java \
+java/security/PrivateKey.java \
+java/security/Provider.java \
+java/security/PublicKey.java \
 java/security/SecureClassLoader.java \
+java/security/SecureRandom.java \
+java/security/Security.java \
+java/security/Signature.java \
+java/security/SignatureException.java \
+java/security/interfaces/DSAKey.java \
+java/security/interfaces/DSAParams.java \
+java/security/interfaces/DSAPrivateKey.java \
+java/security/interfaces/DSAPublicKey.java \
+java/security/interfaces/RSAPrivateCrtKey.java \
+java/security/interfaces/RSAPrivateKey.java \
+java/security/interfaces/RSAPublicKey.java \
+java/security/spec/AlgorithmParameterSpec.java \
+java/security/spec/InvalidKeySpecException.java \
+java/security/spec/InvalidParameterSpecException.java \
+java/security/spec/KeySpec.java \
+java/security/spec/RSAPrivateCrtKeySpec.java \
+java/security/spec/RSAPrivateKeySpec.java \
+java/security/spec/RSAPublicKeySpec.java \
 java/text/BreakIterator.java \
 java/text/CharacterIterator.java \
 java/text/ChoiceFormat.java \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 65cade913ef05eba3c06e5d2051e52b20ba1fb8f..682317dd9fce6dc471f62409ec34333e3479e540 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -514,9 +514,42 @@ java/net/URLStreamHandler.java \
 java/net/URLStreamHandlerFactory.java \
 java/net/UnknownHostException.java \
 java/net/UnknownServiceException.java \
+java/security/AlgorithmParameterGeneratorSpi.java \
+java/security/DigestException.java \
+java/security/GeneralSecurityException.java \
+java/security/InvalidAlgorithmParameterException.java \
+java/security/InvalidKeyException.java \
+java/security/InvalidParameterException.java \
+java/security/Key.java \
+java/security/KeyException.java \
+java/security/KeyPair.java \
+java/security/KeyPairGenerator.java \
+java/security/KeyPairGeneratorSpi.java \
 java/security/MessageDigest.java \
 java/security/NoSuchAlgorithmException.java \
+java/security/NoSuchProviderException.java \
+java/security/PrivateKey.java \
+java/security/Provider.java \
+java/security/PublicKey.java \
 java/security/SecureClassLoader.java \
+java/security/SecureRandom.java \
+java/security/Security.java \
+java/security/Signature.java \
+java/security/SignatureException.java \
+java/security/interfaces/DSAKey.java \
+java/security/interfaces/DSAParams.java \
+java/security/interfaces/DSAPrivateKey.java \
+java/security/interfaces/DSAPublicKey.java \
+java/security/interfaces/RSAPrivateCrtKey.java \
+java/security/interfaces/RSAPrivateKey.java \
+java/security/interfaces/RSAPublicKey.java \
+java/security/spec/AlgorithmParameterSpec.java \
+java/security/spec/InvalidKeySpecException.java \
+java/security/spec/InvalidParameterSpecException.java \
+java/security/spec/KeySpec.java \
+java/security/spec/RSAPrivateCrtKeySpec.java \
+java/security/spec/RSAPrivateKeySpec.java \
+java/security/spec/RSAPublicKeySpec.java \
 java/text/BreakIterator.java \
 java/text/CharacterIterator.java \
 java/text/ChoiceFormat.java \
@@ -899,10 +932,39 @@ DEP_FILES =  .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
 .deps/java/net/URLStreamHandlerFactory.P \
 .deps/java/net/UnknownHostException.P \
 .deps/java/net/UnknownServiceException.P \
+.deps/java/security/AlgorithmParameterGeneratorSpi.P \
+.deps/java/security/DigestException.P \
+.deps/java/security/GeneralSecurityException.P \
+.deps/java/security/InvalidAlgorithmParameterException.P \
+.deps/java/security/InvalidKeyException.P \
+.deps/java/security/InvalidParameterException.P \
+.deps/java/security/Key.P .deps/java/security/KeyException.P \
+.deps/java/security/KeyPair.P .deps/java/security/KeyPairGenerator.P \
+.deps/java/security/KeyPairGeneratorSpi.P \
 .deps/java/security/MessageDigest.P \
 .deps/java/security/NoSuchAlgorithmException.P \
-.deps/java/security/SecureClassLoader.P .deps/java/text/BreakIterator.P \
-.deps/java/text/CharacterIterator.P .deps/java/text/ChoiceFormat.P \
+.deps/java/security/NoSuchProviderException.P \
+.deps/java/security/PrivateKey.P .deps/java/security/Provider.P \
+.deps/java/security/PublicKey.P .deps/java/security/SecureClassLoader.P \
+.deps/java/security/SecureRandom.P .deps/java/security/Security.P \
+.deps/java/security/Signature.P \
+.deps/java/security/SignatureException.P \
+.deps/java/security/interfaces/DSAKey.P \
+.deps/java/security/interfaces/DSAParams.P \
+.deps/java/security/interfaces/DSAPrivateKey.P \
+.deps/java/security/interfaces/DSAPublicKey.P \
+.deps/java/security/interfaces/RSAPrivateCrtKey.P \
+.deps/java/security/interfaces/RSAPrivateKey.P \
+.deps/java/security/interfaces/RSAPublicKey.P \
+.deps/java/security/spec/AlgorithmParameterSpec.P \
+.deps/java/security/spec/InvalidKeySpecException.P \
+.deps/java/security/spec/InvalidParameterSpecException.P \
+.deps/java/security/spec/KeySpec.P \
+.deps/java/security/spec/RSAPrivateCrtKeySpec.P \
+.deps/java/security/spec/RSAPrivateKeySpec.P \
+.deps/java/security/spec/RSAPublicKeySpec.P \
+.deps/java/text/BreakIterator.P .deps/java/text/CharacterIterator.P \
+.deps/java/text/ChoiceFormat.P \
 .deps/java/text/CollationElementIterator.P \
 .deps/java/text/CollationKey.P .deps/java/text/Collator.P \
 .deps/java/text/DateFormat.P .deps/java/text/DateFormatSymbols.P \
diff --git a/libjava/java/security/AlgorithmParameterGeneratorSpi.java b/libjava/java/security/AlgorithmParameterGeneratorSpi.java
new file mode 100644
index 0000000000000000000000000000000000000000..476e1bb40f0842723eb9504db27ca6fe4e5d4162
--- /dev/null
+++ b/libjava/java/security/AlgorithmParameterGeneratorSpi.java
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Stubbed.
+ */
+
+// JDK1.2
+public abstract class AlgorithmParameterGeneratorSpi
+{
+  // FIXME: Stubbed.
+}
diff --git a/libjava/java/security/DigestException.java b/libjava/java/security/DigestException.java
new file mode 100644
index 0000000000000000000000000000000000000000..8c6b2db8af899a21699fc9c6e2e6a9ffc3614bc1
--- /dev/null
+++ b/libjava/java/security/DigestException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class DigestException extends GeneralSecurityException
+{
+  public DigestException()
+  {
+    super();
+  }
+
+  public DigestException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/GeneralSecurityException.java b/libjava/java/security/GeneralSecurityException.java
new file mode 100644
index 0000000000000000000000000000000000000000..9d30737285a52ba4980186fe15d64042e004cca3
--- /dev/null
+++ b/libjava/java/security/GeneralSecurityException.java
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+// JDK1.2
+public class GeneralSecurityException extends Exception
+{
+  public GeneralSecurityException()
+  {
+    super();
+  }
+
+  public GeneralSecurityException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/InvalidAlgorithmParameterException.java b/libjava/java/security/InvalidAlgorithmParameterException.java
new file mode 100644
index 0000000000000000000000000000000000000000..35063a961c21ebbb4edda7f9aaef4c17ca03a7cb
--- /dev/null
+++ b/libjava/java/security/InvalidAlgorithmParameterException.java
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 2, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+// JDK1.2
+public class InvalidAlgorithmParameterException extends GeneralSecurityException
+{
+  public InvalidAlgorithmParameterException()
+  {
+    super();
+  }
+
+  public InvalidAlgorithmParameterException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/InvalidKeyException.java b/libjava/java/security/InvalidKeyException.java
new file mode 100644
index 0000000000000000000000000000000000000000..3a9a69aade1fa4955f23e67daca2c04a2f8420ee
--- /dev/null
+++ b/libjava/java/security/InvalidKeyException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class InvalidKeyException extends KeyException
+{
+  public InvalidKeyException()
+  {
+    super();
+  }
+
+  public InvalidKeyException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/InvalidParameterException.java b/libjava/java/security/InvalidParameterException.java
new file mode 100644
index 0000000000000000000000000000000000000000..5ece0126b57483443bbfd8c057a42269ed0e2413
--- /dev/null
+++ b/libjava/java/security/InvalidParameterException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class InvalidParameterException extends IllegalArgumentException
+{
+  public InvalidParameterException()
+  {
+    super();
+  }
+
+  public InvalidParameterException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/Key.java b/libjava/java/security/Key.java
new file mode 100644
index 0000000000000000000000000000000000000000..4bf32c5b83ebbf6ee66ebbcd37dc1aaeb81066ba
--- /dev/null
+++ b/libjava/java/security/Key.java
@@ -0,0 +1,29 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security;
+import java.io.Serializable;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface Key extends Serializable
+{
+  // FIXME: need to set this at some point when serialization is implemented.
+  public static final long serialVersionUID;
+
+  public String getAlgorithm();
+  public String getFormat();
+  public byte[] getEncoded();
+}
diff --git a/libjava/java/security/KeyException.java b/libjava/java/security/KeyException.java
new file mode 100644
index 0000000000000000000000000000000000000000..634d8ce772e25ff0fa5f720e3427642a04ec7afc
--- /dev/null
+++ b/libjava/java/security/KeyException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class KeyException extends GeneralSecurityException
+{
+  public KeyException()
+  {
+    super();
+  }
+
+  public KeyException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/KeyPair.java b/libjava/java/security/KeyPair.java
new file mode 100644
index 0000000000000000000000000000000000000000..b8b2934733331825eb1f99843b2bf36b7304bbdf
--- /dev/null
+++ b/libjava/java/security/KeyPair.java
@@ -0,0 +1,41 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date February 9, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public class KeyPair /* FIXME: implements serializable */
+{
+  public KeyPair (PublicKey publicKey, PrivateKey privateKey)
+  {
+    this.publicKey = publicKey;
+    this.privateKey = privateKey;
+  }
+
+  public PublicKey getPublic ()
+  {
+    return publicKey;
+  }
+
+  public PrivateKey getPrivate ()
+  {
+    return privateKey;
+  }
+
+  // The keys.
+  private PublicKey publicKey;
+  private PrivateKey privateKey;
+}
diff --git a/libjava/java/security/KeyPairGenerator.java b/libjava/java/security/KeyPairGenerator.java
new file mode 100644
index 0000000000000000000000000000000000000000..7954c3270ac170d9b4fb2687ec82a8a4112320d9
--- /dev/null
+++ b/libjava/java/security/KeyPairGenerator.java
@@ -0,0 +1,86 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 10, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Partially implemented to the 1.1 spec.
+ * It is known not to comply with the 1.2 spec.
+ */
+
+public abstract class KeyPairGenerator extends KeyPairGeneratorSpi
+{
+  protected KeyPairGenerator(String algorithm)
+  {
+    name = algorithm;
+  }
+
+  public static KeyPairGenerator getInstance(String algorithm)
+    throws NoSuchAlgorithmException
+  {
+    String name = "KeyPairGenerator." + algorithm;
+    Provider[] provs = Security.getProviders();
+    for (int i = 0; i < provs.length; ++i)
+      {
+	String val = provs[i].getProperty(name);
+	if (val != null)
+	  {
+	    try
+	      {
+		return (KeyPairGenerator) Class.forName(val).newInstance();
+	      }
+	    catch (Throwable _)
+	      {
+		// We just ignore failures.
+	      }
+	  }
+      }
+
+    throw new NoSuchAlgorithmException(algorithm);
+  }
+
+  public static KeyPairGenerator getInstance(String algorithm, String provider)
+    throws NoSuchAlgorithmException, NoSuchProviderException
+  {
+    String name = "KeyPairGenerator." + algorithm;
+    Provider p = Security.getProvider(provider);
+    if (p == null)
+      throw new NoSuchProviderException(provider);
+    String val = p.getProperty(name);
+    if (val != null)
+      {
+	try
+	  {
+	    return (KeyPairGenerator) Class.forName(val).newInstance();
+	  }
+	catch (Throwable _)
+	  {
+	    // Nothing.
+	  }
+      }
+
+    throw new NoSuchAlgorithmException(algorithm);
+  }
+
+  public String getAlgorithm()
+  {
+    return name;
+  }
+
+  public abstract void initialize(int strength, SecureRandom random);
+  public abstract KeyPair generateKeyPair();
+
+  // Algorithm name.
+  private String name;
+}
diff --git a/libjava/java/security/KeyPairGeneratorSpi.java b/libjava/java/security/KeyPairGeneratorSpi.java
new file mode 100644
index 0000000000000000000000000000000000000000..46520b4aea94c31e573593c9df931e4489e0f9c7
--- /dev/null
+++ b/libjava/java/security/KeyPairGeneratorSpi.java
@@ -0,0 +1,26 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Partially implemented.
+ */
+
+// JDK1.2
+public abstract class KeyPairGeneratorSpi
+{
+  public abstract void initialize(int keysize, SecureRandom random);
+  public abstract KeyPair generateKeyPair();
+}
diff --git a/libjava/java/security/MessageDigest.java b/libjava/java/security/MessageDigest.java
index 67e4911d1fdbd558ba12d99050a50d08a7878420..04546cdde195b4b4245562d07c13c693c0ed611e 100644
--- a/libjava/java/security/MessageDigest.java
+++ b/libjava/java/security/MessageDigest.java
@@ -1,6 +1,6 @@
 // MessageDigest.java
 
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 2000  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -10,55 +10,135 @@ details.  */
 
 package java.security;
 
-// FIXME: This is just a stub for a proper implementation.
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date February 11, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.1 API Specification.
+ * Status:  Believed complete and correct to 1.1 spec.
+ * It is known not to comply with the 1.2 spec.
+ */
+
 public abstract class MessageDigest
 {
-    private static final byte[] dummy = { 0 };
-
-    public static MessageDigest getInstance(String algorithm)
-	throws NoSuchAlgorithmException
-    {
-	Object	obj;
-
-	try {
-	    obj = Class.forName(algorithm).newInstance();
-	} catch (Exception e) {
-	    throw new NoSuchAlgorithmException("algorithm " 
-					       + algorithm 
-					       + " not available.");
-	}
-	
-	return (MessageDigest) obj;
-    }
-
-    public void update(byte input)
-    {
-	// FIXME
-    }
-
-    public void update(byte[] input, int offset, int len)
-    {
-	// FIXME
-    }
-
-    public void update(byte[] input)
-    {
-	// FIXME
-    }
-
-    public byte[] digest()
-    {
-	return dummy;
-    }
-
-    public byte[] digest(byte[] input)
-    {
-	update(input);
-	return digest();
-    }
-    
-    public void reset()
-    {
-	// FIXME
-    }
+  protected MessageDigest (String algorithm)
+  {
+    name = algorithm;
+  }
+
+  public static MessageDigest getInstance (String algorithm)
+    throws NoSuchAlgorithmException
+  {
+    String name = "MessageDigest." + algorithm;
+    Provider[] provs = Security.getProviders ();
+    for (int i = 0; i < provs.length; ++i)
+      {
+	String val = provs[i].getProperty (name);
+	if (val != null)
+	  {
+	    try
+	      {
+		return (MessageDigest) Class.forName(val).newInstance ();
+	      }
+	    catch (Throwable _)
+	      {
+		// We just ignore failures.
+	      }
+	  }
+      }
+
+    throw new NoSuchAlgorithmException (algorithm);
+  }
+
+  public static MessageDigest getInstance (String algorithm, String provider)
+    throws NoSuchAlgorithmException, NoSuchProviderException
+  {
+    String name = "MessageDigest." + algorithm;
+    Provider p = Security.getProvider (provider);
+    if (p == null)
+      throw new NoSuchProviderException (provider);
+    String val = p.getProperty (name);
+    if (val != null)
+      {
+	try
+	  {
+	    return (MessageDigest) Class.forName(val).newInstance ();
+	  }
+	catch (Throwable _)
+	  {
+	    // Nothing.
+	  }
+      }
+
+    throw new NoSuchAlgorithmException (algorithm);
+  }
+
+  public void update (byte input)
+  {
+    engineUpdate (input);
+  }
+
+  public void update (byte[] input, int offset, int len)
+  {
+    engineUpdate (input, offset, len);
+  }
+
+  public void update (byte[] input)
+  {
+    engineUpdate (input, 0, input.length);
+  }
+
+  public byte[] digest ()
+  {
+    return engineDigest ();
+  }
+
+  public byte[] digest (byte[] input)
+  {
+    update (input);
+    return engineDigest ();
+  }
+
+  public String toString ()
+  {
+    // There is no spec for this.
+    return "[MessageDigest: " + name + "]";
+  }
+
+  public static boolean isEqual (byte[] digesta, byte[] digestb)
+  {
+    if (digesta == digestb)
+      return true;
+    if (digesta.length != digestb.length)
+      return false;
+    for (int i = digesta.length - 1; i >= 0; --i)
+      if (digesta[i] != digestb[i])
+	return false;
+    return true;
+  }
+
+  public void reset ()
+  {
+    engineReset ();
+  }
+
+  public final String getAlgorithm ()
+  {
+    return name;
+  }
+
+  protected abstract void engineUpdate (byte input);
+  protected abstract void engineUpdate (byte input[], int offset, int len);
+  protected abstract byte[] engineDigest ();
+  protected abstract void engineReset ();
+
+  public Object clone() throws CloneNotSupportedException
+  {
+    return super.clone ();
+  }
+
+  // Algorithm name.
+  private String name;
 }
diff --git a/libjava/java/security/NoSuchProviderException.java b/libjava/java/security/NoSuchProviderException.java
new file mode 100644
index 0000000000000000000000000000000000000000..d7d0c853efa707186c063155ee282b08d2a849a4
--- /dev/null
+++ b/libjava/java/security/NoSuchProviderException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 4, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class NoSuchProviderException extends GeneralSecurityException
+{
+  public NoSuchProviderException()
+  {
+    super();
+  }
+
+  public NoSuchProviderException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/PrivateKey.java b/libjava/java/security/PrivateKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..13b9be34b4d4ecd4b8665fa851f9d985ec8bc174
--- /dev/null
+++ b/libjava/java/security/PrivateKey.java
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface PrivateKey extends Key
+{
+  // This interface contains no methods or constants.  It merely serves
+  // to group (and provide type safety for) all private key interfaces.
+}
diff --git a/libjava/java/security/Provider.java b/libjava/java/security/Provider.java
new file mode 100644
index 0000000000000000000000000000000000000000..ac2cd7864b551cfb376feb2bd513535fbd137faa
--- /dev/null
+++ b/libjava/java/security/Provider.java
@@ -0,0 +1,53 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+import java.util.Properties;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Partially implemented.
+ */
+
+public abstract class Provider extends Properties
+{
+  // FIXME: Check the following property values against specs!
+  protected Provider(String name, double version, String info)
+  {
+    super();
+    put("java.security.Provider.Name", name);
+    put("java.security.Provider.Version", Double.toString(version));
+    put("java.security.Provider.Info", info);
+  }
+
+  public String getName()
+  {
+    return getProperty("java.security.Provider.Name");
+  }
+
+  public double getVersion()
+  {
+    return Double.valueOf(getProperty("java.security.Provider.Version")).doubleValue();
+  }
+
+  public String getInfo()
+  {
+    return getProperty("java.security.Provider.Info");
+  }
+
+  public String toString()
+  {
+    // FIXME: Check this string against the spec.
+    return getName() + " " + getProperty("java.security.Provider.Version");
+  }
+}
diff --git a/libjava/java/security/PublicKey.java b/libjava/java/security/PublicKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..5c30c627e3188faf704effeb1ff2012cedb6acaf
--- /dev/null
+++ b/libjava/java/security/PublicKey.java
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface PublicKey extends Key
+{
+  // This interface contains no methods or constants.  It merely serves
+  // to group (and provide type safety for) all private key interfaces.
+}
diff --git a/libjava/java/security/SecureClassLoader.java b/libjava/java/security/SecureClassLoader.java
index 4a0b60b42d23bda91e076ba201c44c2fabe158ae..f49f8ac214c63ce3cbb87200b3bc345f96bd09c0 100644
--- a/libjava/java/security/SecureClassLoader.java
+++ b/libjava/java/security/SecureClassLoader.java
@@ -8,6 +8,7 @@ details.  */
 
 package java.security;
 
+// JDK1.2
 public class SecureClassLoader extends ClassLoader 
 {
     public SecureClassLoader ()
diff --git a/libjava/java/security/SecureRandom.java b/libjava/java/security/SecureRandom.java
new file mode 100644
index 0000000000000000000000000000000000000000..6f396dce1e30a9bd10d07e47fa67a80f842cc93d
--- /dev/null
+++ b/libjava/java/security/SecureRandom.java
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+import java.util.Random;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Stubbed.
+ */
+
+public class SecureRandom extends Random
+{
+  // FIXME: Stubbed.
+}
diff --git a/libjava/java/security/Security.java b/libjava/java/security/Security.java
new file mode 100644
index 0000000000000000000000000000000000000000..87a0088281baebe8be0c2c185c08b43bb5cca311
--- /dev/null
+++ b/libjava/java/security/Security.java
@@ -0,0 +1,107 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.Vector;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date February 8, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Still missing the deprecated getAlgorithmProperty method.
+ */
+
+public final class Security
+{
+  public static int insertProviderAt (Provider provider, int position)
+  {
+    SecurityManager sm = System.getSecurityManager ();
+    if (sm != null)
+      {
+	// FIXME: need SecurityPermission.
+	// sm.checkSecurityAccess ("insertProvider." + provider.getName ());
+      }
+    if (providers.indexOf (provider) != -1)
+      return -1;
+    if (position > providers.size ())
+      position = providers.size ();
+    providers.insertElementAt (provider, position);
+    return providers.indexOf (provider);
+  }
+
+  public static int addProvider (Provider provider)
+  {
+    return insertProviderAt (provider, providers.size ());
+  }
+
+  public static void removeProvider (String name)
+  {
+    SecurityManager sm = System.getSecurityManager ();
+    if (sm != null)
+      {
+	// FIXME: need SecurityPermission.
+	// sm.checkSecurityAccess ("removeProvider." + name);
+      }
+    Provider p = getProvider (name);
+    if (p != null)
+      providers.removeElement (p);
+  }
+
+  public static Provider[] getProviders ()
+  {
+    Provider[] r = new Provider[providers.size ()];
+    providers.copyInto (r);
+    return r;
+  }
+
+  public static Provider getProvider (String name)
+  {
+    Enumeration e = providers.elements ();
+    while (e.hasMoreElements ())
+      {
+	Provider p = (Provider) e.nextElement ();
+	if (name.equals (p.getName ()))
+	  return p;
+      }
+    return null;
+  }
+
+  public static String getProperty (String key)
+  {
+    SecurityManager sm = System.getSecurityManager ();
+    if (sm != null)
+      {
+	// FIXME: need SecurityPermission.
+	// sm.checkSecurityAccess ("getProperty." + key);
+      }
+    return props.getProperty (key);
+  }
+
+  public static void setProperty (String key, String value)
+  {
+    SecurityManager sm = System.getSecurityManager ();
+    if (sm != null)
+      {
+	// FIXME: need SecurityPermission.
+	// sm.checkSecurityAccess ("setProperty." + key);
+      }
+    props.setProperty (key, value);
+  }
+
+  // The providers we list.
+  private static Vector providers = new Vector ();
+
+  // Security propertiesl
+  private static Properties props = new Properties ();
+}
diff --git a/libjava/java/security/Signature.java b/libjava/java/security/Signature.java
new file mode 100644
index 0000000000000000000000000000000000000000..760f62551d8dfd98858533051cf8946da2ee92d6
--- /dev/null
+++ b/libjava/java/security/Signature.java
@@ -0,0 +1,173 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date February 11, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.1 API Specification.
+ * Status:  Believed complete and correct to 1.1 spec.
+ * It is known not to comply with the 1.2 spec.
+ */
+
+public abstract class Signature
+{
+  protected Signature (String name)
+  {
+    state = UNINITIALIZED;
+    this.name = name;
+  }
+
+  public static Signature getInstance (String algorithm)
+    throws NoSuchAlgorithmException
+  {
+    String name = "Signature." + algorithm;
+    Provider[] provs = Security.getProviders ();
+    for (int i = 0; i < provs.length; ++i)
+      {
+	String val = provs[i].getProperty (name);
+	if (val != null)
+	  {
+	    try
+	      {
+		return (Signature) Class.forName(val).newInstance ();
+	      }
+	    catch (Throwable _)
+	      {
+		// We just ignore failures.
+	      }
+	  }
+      }
+
+    throw new NoSuchAlgorithmException (algorithm);
+  }
+
+  public static Signature getInstance (String algorithm, String provider)
+    throws NoSuchAlgorithmException, NoSuchProviderException
+  {
+    String name = "Signature." + algorithm;
+    Provider p = Security.getProvider (provider);
+    if (p == null)
+      throw new NoSuchProviderException (provider);
+    String val = p.getProperty (name);
+    if (val != null)
+      {
+	try
+	  {
+	    return (Signature) Class.forName(val).newInstance ();
+	  }
+	catch (Throwable _)
+	  {
+	    // Nothing.
+	  }
+      }
+
+    throw new NoSuchAlgorithmException (algorithm);
+  }
+
+  public final void initVerify (PublicKey publicKey)
+    throws InvalidKeyException
+  {
+    engineInitVerify (publicKey);
+  }
+
+  public final void initSign (PrivateKey privateKey)
+    throws InvalidKeyException
+  {
+    engineInitSign (privateKey);
+  }
+
+  public final byte[] sign ()
+    throws SignatureException
+  {
+    return engineSign ();
+  }
+
+  public final boolean verify (byte[] signature)
+    throws SignatureException
+  {
+    return engineVerify (signature);
+  }
+
+  public final void update (byte b)
+    throws SignatureException
+  {
+    engineUpdate (b);
+  }
+
+  public final void update (byte[] data)
+    throws SignatureException
+  {
+    engineUpdate (data, 0, data.length);
+  }
+
+  public final void update (byte[] data, int off, int len)
+    throws SignatureException
+  {
+    engineUpdate (data, off, len);
+  }
+
+  public final String getAlgorithm ()
+  {
+    return name;
+  }
+
+  public String toString ()
+  {
+    // There is no spec for this.  FIXME: this is a bad choice.
+    return name + "; state = " + state;
+  }
+
+  public final void setParameter (String param, Object value)
+    throws InvalidParameterException
+  {
+    engineSetParameter (param, value);
+  }
+
+  public final Object getParameter (String param)
+    throws InvalidParameterException
+  {
+    return engineGetParameter (param);
+  }
+
+  protected abstract void engineInitVerify (PublicKey publicKey)
+    throws InvalidKeyException;
+  protected abstract void engineInitSign (PrivateKey privateKey)
+    throws InvalidKeyException;
+  protected abstract void engineUpdate (byte b)
+    throws SignatureException;
+  protected abstract void engineUpdate (byte[] b, int off, int len)
+    throws SignatureException;
+  protected abstract byte[] engineSign ()
+    throws SignatureException;
+  protected abstract boolean engineVerify (byte[] sigBytes)
+    throws SignatureException;
+  protected abstract void engineSetParameter (String param, Object value)
+    throws InvalidParameterException;
+  protected abstract Object engineGetParameter (String param)
+    throws InvalidParameterException;
+
+  public Object clone() throws CloneNotSupportedException
+  {
+    return super.clone ();
+  }
+
+  protected static final int UNINITIALIZED = 0;
+  protected static final int SIGN          = 2;
+  protected static final int VERIFY        = 3;
+
+  // Current state.
+  protected int state;
+
+  // Name of this object.
+  private String name;
+}
diff --git a/libjava/java/security/SignatureException.java b/libjava/java/security/SignatureException.java
new file mode 100644
index 0000000000000000000000000000000000000000..dc1c87a631794dc5b5d0e2274c34e09eb65ae4c7
--- /dev/null
+++ b/libjava/java/security/SignatureException.java
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/**
+ * Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+public class SignatureException extends GeneralSecurityException
+{
+  public SignatureException()
+  {
+    super();
+  }
+
+  public SignatureException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/interfaces/DSAKey.java b/libjava/java/security/interfaces/DSAKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..3920d7b455a74733e532bb4ba7292d1abc3990c2
--- /dev/null
+++ b/libjava/java/security/interfaces/DSAKey.java
@@ -0,0 +1,23 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface DSAKey
+{
+  public DSAParams getParams();
+}
diff --git a/libjava/java/security/interfaces/DSAParams.java b/libjava/java/security/interfaces/DSAParams.java
new file mode 100644
index 0000000000000000000000000000000000000000..8483bd5cd2c4eaa1e5e51ae82761f969d859cd19
--- /dev/null
+++ b/libjava/java/security/interfaces/DSAParams.java
@@ -0,0 +1,26 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface DSAParams
+{
+  public BigInteger getP();
+  public BigInteger getQ();
+  public BigInteger getG();
+}
diff --git a/libjava/java/security/interfaces/DSAPrivateKey.java b/libjava/java/security/interfaces/DSAPrivateKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..833ee3af5a7c74fd195d3f60a5fcb5baa5785afd
--- /dev/null
+++ b/libjava/java/security/interfaces/DSAPrivateKey.java
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.security.PrivateKey;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface DSAPrivateKey extends DSAKey, PrivateKey
+{
+  public static final long serialVersionUID;
+
+  public BigInteger getX();
+}
diff --git a/libjava/java/security/interfaces/DSAPublicKey.java b/libjava/java/security/interfaces/DSAPublicKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..48949ded243f6e5f4160526f8b14bd07735cbbd3
--- /dev/null
+++ b/libjava/java/security/interfaces/DSAPublicKey.java
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.security.PublicKey;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+public interface DSAPublicKey extends DSAKey, PublicKey
+{
+  public static final long serialVersionUID;
+
+  public BigInteger getY();
+}
diff --git a/libjava/java/security/interfaces/RSAPrivateCrtKey.java b/libjava/java/security/interfaces/RSAPrivateCrtKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..cca294ab4a37b08fa929d0e3d310220689978e75
--- /dev/null
+++ b/libjava/java/security/interfaces/RSAPrivateCrtKey.java
@@ -0,0 +1,30 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+// JDK1.2
+public interface RSAPrivateCrtKey extends RSAPrivateKey
+{
+  public BigInteger getPublicExponent();
+  public BigInteger getPrimeP();
+  public BigInteger getPrimeQ();
+  public BigInteger getPrimeExponentP();
+  public BigInteger getPrimeExponentQ();
+  public BigInteger getCrtCoefficient();
+}
diff --git a/libjava/java/security/interfaces/RSAPrivateKey.java b/libjava/java/security/interfaces/RSAPrivateKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..4c16b05e248d0fc3a84a6b8deaa24241356a1b5c
--- /dev/null
+++ b/libjava/java/security/interfaces/RSAPrivateKey.java
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.security.PrivateKey;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+// JDK1.2
+public interface RSAPrivateKey extends PrivateKey
+{
+  public BigInteger getModulus();
+  public BigInteger getPrivateExponent();
+}
diff --git a/libjava/java/security/interfaces/RSAPublicKey.java b/libjava/java/security/interfaces/RSAPublicKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..0bee88df91c7dba2ddfc29da8deca48c447b51b3
--- /dev/null
+++ b/libjava/java/security/interfaces/RSAPublicKey.java
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.interfaces;
+import java.security.PublicKey;
+import java.math.BigInteger;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+// JDK1.2
+public interface RSAPublicKey extends PublicKey
+{
+  public BigInteger getModulus();
+  public BigInteger getPublicExponent();
+}
diff --git a/libjava/java/security/spec/AlgorithmParameterSpec.java b/libjava/java/security/spec/AlgorithmParameterSpec.java
new file mode 100644
index 0000000000000000000000000000000000000000..5781623b746da2e991e46b70f7980fc5e2d89035
--- /dev/null
+++ b/libjava/java/security/spec/AlgorithmParameterSpec.java
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.spec;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+// JDK1.2
+public interface AlgorithmParameterSpec
+{
+  // This interface contains no methods or constants. Its only purpose is
+  // to group (and provide type safety for) all key specifications.
+}
diff --git a/libjava/java/security/spec/InvalidKeySpecException.java b/libjava/java/security/spec/InvalidKeySpecException.java
new file mode 100644
index 0000000000000000000000000000000000000000..632fd251e7a53924a83a4708098c897ad38e4c86
--- /dev/null
+++ b/libjava/java/security/spec/InvalidKeySpecException.java
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security.spec;
+import java.security.GeneralSecurityException;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+// JDK1.2
+public class InvalidKeySpecException extends GeneralSecurityException
+{
+  public InvalidKeySpecException()
+  {
+    super();
+  }
+
+  public InvalidKeySpecException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/spec/InvalidParameterSpecException.java b/libjava/java/security/spec/InvalidParameterSpecException.java
new file mode 100644
index 0000000000000000000000000000000000000000..1e2aff5c3f609657a7c1168e8bc117ed3c18d0ea
--- /dev/null
+++ b/libjava/java/security/spec/InvalidParameterSpecException.java
@@ -0,0 +1,33 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+package java.security.spec;
+import java.security.GeneralSecurityException;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+
+// JDK1.2
+public class InvalidParameterSpecException extends GeneralSecurityException
+{
+  public InvalidParameterSpecException()
+  {
+    super();
+  }
+
+  public InvalidParameterSpecException(String msg)
+  {
+    super(msg);
+  }
+}
diff --git a/libjava/java/security/spec/KeySpec.java b/libjava/java/security/spec/KeySpec.java
new file mode 100644
index 0000000000000000000000000000000000000000..75e50f9f656da1d17d5aad609fbb0fe0cbf7f3d4
--- /dev/null
+++ b/libjava/java/security/spec/KeySpec.java
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.spec;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 1, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Believed complete and correct.
+ */
+ 
+// JDK1.2
+public interface KeySpec
+{
+  // This interface contains no methods or constants. Its only purpose is
+  // to group (and provide type safety for) all key specifications.
+}
diff --git a/libjava/java/security/spec/RSAPrivateCrtKeySpec.java b/libjava/java/security/spec/RSAPrivateCrtKeySpec.java
new file mode 100644
index 0000000000000000000000000000000000000000..6a31163c09efd135712aeedbe4183169586929ed
--- /dev/null
+++ b/libjava/java/security/spec/RSAPrivateCrtKeySpec.java
@@ -0,0 +1,23 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.spec;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Stubbed.
+ */
+ 
+// JDK1.2
+public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec
+{
+}
diff --git a/libjava/java/security/spec/RSAPrivateKeySpec.java b/libjava/java/security/spec/RSAPrivateKeySpec.java
new file mode 100644
index 0000000000000000000000000000000000000000..4f38a2d0ba595713341931d26213877918c70f35
--- /dev/null
+++ b/libjava/java/security/spec/RSAPrivateKeySpec.java
@@ -0,0 +1,23 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.spec;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 7, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Stubbed.
+ */
+ 
+// JDK1.2
+public class RSAPrivateKeySpec implements KeySpec
+{
+}
diff --git a/libjava/java/security/spec/RSAPublicKeySpec.java b/libjava/java/security/spec/RSAPublicKeySpec.java
new file mode 100644
index 0000000000000000000000000000000000000000..0bdcd22922ef20d5b22573b502ac3b844157d0fa
--- /dev/null
+++ b/libjava/java/security/spec/RSAPublicKeySpec.java
@@ -0,0 +1,23 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+ 
+package java.security.spec;
+
+/**
+ * @author Warren Levy <warrenl@cygnus.com>
+ * @date February 10, 2000.
+ */
+
+/* Written using on-line Java Platform 1.2 API Specification.
+ * Status:  Stubbed.
+ */
+ 
+// JDK1.2
+public class RSAPublicKeySpec implements KeySpec
+{
+}