[kaffe] CVS kaffe (dalibor): Replaced java/security/spec/ with implementation from GNU Classpath
Kaffe CVS
cvs-commits at kaffe.org
Mon Mar 22 09:05:03 PST 2004
PatchSet 4560
Date: 2004/03/22 17:00:54
Author: dalibor
Branch: HEAD
Tag: (none)
Log:
Replaced java/security/spec/ with implementation from GNU Classpath
2004-03-22 Dalibor Topic <robilad at kaffe.org>
* libraries/javalib/java/security/spec/DSAParameterSpec.java,
libraries/javalib/java/security/spec/DSAPrivateKeySpec.java,
libraries/javalib/java/security/spec/DSAPublicKeySpec.java,
libraries/javalib/java/security/spec/EncodedKeySpec.java,
libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java,
libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java,
libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java,
libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java,
libraries/javalib/java/security/spec/RSAPrivateKeySpec.java,
libraries/javalib/java/security/spec/RSAPublicKeySpec.java,
libraries/javalib/java/security/spec/X509EncodedKeySpec.java:
Replaced by implementation from GNU Classpath.
Members:
ChangeLog:1.2138->1.2139
libraries/javalib/java/security/spec/DSAParameterSpec.java:1.2->1.3
libraries/javalib/java/security/spec/DSAPrivateKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/DSAPublicKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/EncodedKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java:1.1->1.2
libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java:1.2->1.3
libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/RSAPrivateKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/RSAPublicKeySpec.java:1.1->1.2
libraries/javalib/java/security/spec/X509EncodedKeySpec.java:1.1->1.2
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2138 kaffe/ChangeLog:1.2139
--- kaffe/ChangeLog:1.2138 Mon Mar 22 15:14:28 2004
+++ kaffe/ChangeLog Mon Mar 22 17:00:54 2004
@@ -1,5 +1,20 @@
2004-03-22 Dalibor Topic <robilad at kaffe.org>
+ * libraries/javalib/java/security/spec/DSAParameterSpec.java,
+ libraries/javalib/java/security/spec/DSAPrivateKeySpec.java,
+ libraries/javalib/java/security/spec/DSAPublicKeySpec.java,
+ libraries/javalib/java/security/spec/EncodedKeySpec.java,
+ libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java,
+ libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java,
+ libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java,
+ libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java,
+ libraries/javalib/java/security/spec/RSAPrivateKeySpec.java,
+ libraries/javalib/java/security/spec/RSAPublicKeySpec.java,
+ libraries/javalib/java/security/spec/X509EncodedKeySpec.java:
+ Replaced by implementation from GNU Classpath.
+
+2004-03-22 Dalibor Topic <robilad at kaffe.org>
+
* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
(tMapPriorities): Only use sched_get_priority_min|max
if they are available on the platform.
Index: kaffe/libraries/javalib/java/security/spec/DSAParameterSpec.java
diff -u kaffe/libraries/javalib/java/security/spec/DSAParameterSpec.java:1.2 kaffe/libraries/javalib/java/security/spec/DSAParameterSpec.java:1.3
--- kaffe/libraries/javalib/java/security/spec/DSAParameterSpec.java:1.2 Mon Mar 22 11:25:02 2004
+++ kaffe/libraries/javalib/java/security/spec/DSAParameterSpec.java Mon Mar 22 17:00:56 2004
@@ -1,68 +1,100 @@
-/*
- * DSAParamaterSpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* DSAParameterSpec.java --- DSA Parameter Specificaton class
+ Copyright (C) 1999 Free Software Foundation, Inc.
-package java.security.spec;
+This file is part of GNU Classpath.
-import java.math.BigInteger;
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.security.spec;
import java.security.interfaces.DSAParams;
+import java.math.BigInteger;
-public class DSAParameterSpec
- implements AlgorithmParameterSpec, DSAParams
+/**
+ DSA Parameter class Specification. Used to maintain the DSA
+ Parameters.
+
+ @since JDK 1.2
+
+ @author Mark Benvenuto
+*/
+public class DSAParameterSpec extends Object implements AlgorithmParameterSpec, DSAParams
{
- private final BigInteger p;
- private final BigInteger q;
- private final BigInteger g;
-
- public DSAParameterSpec(BigInteger p,
- BigInteger q,
- BigInteger g)
- {
- /* XXX Are these checks valid? */
- if( p.signum() < 0 )
- throw new IllegalArgumentException();
- if( q.signum() < 0 )
- throw new IllegalArgumentException();
- if( g.signum() < 0 )
- throw new IllegalArgumentException();
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- public BigInteger getP()
- {
- return this.p;
- }
-
- public BigInteger getQ()
- {
- return this.q;
- }
-
- public BigInteger getG()
- {
- return this.g;
- }
-
- public String toString()
- {
- return "DSAParameterSpec[p="
- + this.p
- + "; q="
- + this.q
- + "; g="
- + this.g
- + "]";
- }
+ private BigInteger p = null;
+ private BigInteger q = null;
+ private BigInteger g = null;
+
+ /**
+ Constructs a new DSAParameterSpec with the specified p, q, and g.
+
+ @param p the prime
+ @param q the sub-prime
+ @param g the base
+ */
+ public DSAParameterSpec(BigInteger p, BigInteger q, BigInteger g)
+ {
+ this.p = p;
+ this.q = q;
+ this.g = g;
+ }
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getP()
+ {
+ return this.p;
+ }
+
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getQ()
+ {
+ return this.q;
+ }
+
+ /**
+ Returns g for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getG()
+ {
+ return this.g;
+ }
+
}
Index: kaffe/libraries/javalib/java/security/spec/DSAPrivateKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/DSAPrivateKeySpec.java:1.1 kaffe/libraries/javalib/java/security/spec/DSAPrivateKeySpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/DSAPrivateKeySpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/DSAPrivateKeySpec.java Mon Mar 22 17:00:56 2004
@@ -1,79 +1,113 @@
-/*
- * DSAPrivateKeySpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* DSAPrivateKeySpec.java --- DSA Private Key Specificaton class
+ Copyright (C) 1999 Free Software Foundation, Inc.
-package java.security.spec;
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.security.spec;
import java.math.BigInteger;
-public class DSAPrivateKeySpec
- implements KeySpec
+/**
+ DSA Private Key class Specification. Used to maintain the DSA
+ Private Keys.
+
+ @since JDK 1.2
+
+ @author Mark Benvenuto
+*/
+public class DSAPrivateKeySpec extends Object implements KeySpec
{
- private final BigInteger x;
- private final BigInteger p;
- private final BigInteger q;
- private final BigInteger g;
-
- public DSAPrivateKeySpec(BigInteger x,
- BigInteger p,
- BigInteger q,
- BigInteger g)
- {
- /* XXX Are these checks valid? */
- if( x.signum() < 0 )
- throw new IllegalArgumentException();
- if( p.signum() < 0 )
- throw new IllegalArgumentException();
- if( q.signum() < 0 )
- throw new IllegalArgumentException();
- if( g.signum() < 0 )
- throw new IllegalArgumentException();
- this.x = x;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- public BigInteger getX()
- {
- return this.x;
- }
-
- public BigInteger getP()
- {
- return this.p;
- }
-
- public BigInteger getQ()
- {
- return this.q;
- }
-
- public BigInteger getG()
- {
- return this.g;
- }
-
- public String toString()
- {
- return "DSAPrivateKeySpec[x="
- + this.x
- + "; p="
- + this.p
- + "; q="
- + this.q
- + "; g="
- + this.g
- + "]";
- }
+ private BigInteger x = null;
+ private BigInteger p = null;
+ private BigInteger q = null;
+ private BigInteger g = null;
+
+ /**
+ Constructs a new DSAPrivateKeySpec with the specified x, p, q, and g.
+
+ @param x the private key
+ @param p the prime
+ @param q the sub-prime
+ @param g the base
+ */
+ public DSAPrivateKeySpec(BigInteger x, BigInteger p, BigInteger q, BigInteger g)
+ {
+ this.x = x;
+ this.p = p;
+ this.q = q;
+ this.g = g;
+ }
+
+ /**
+ Returns private key x for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getX()
+ {
+ return this.x;
+ }
+
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getP()
+ {
+ return this.p;
+ }
+
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getQ()
+ {
+ return this.q;
+ }
+
+ /**
+ Returns g for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getG()
+ {
+ return this.g;
+ }
+
}
Index: kaffe/libraries/javalib/java/security/spec/DSAPublicKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/DSAPublicKeySpec.java:1.1 kaffe/libraries/javalib/java/security/spec/DSAPublicKeySpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/DSAPublicKeySpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/DSAPublicKeySpec.java Mon Mar 22 17:00:56 2004
@@ -1,79 +1,113 @@
-/*
- * DSAPublicKeySpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* DSAPublicKeySpec.java --- DSA Public Key Specificaton class
+ Copyright (C) 1999 Free Software Foundation, Inc.
-package java.security.spec;
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.security.spec;
import java.math.BigInteger;
-public class DSAPublicKeySpec
- implements KeySpec
+/**
+ DSA Public Key class Specification. Used to maintain the DSA
+ Public Keys.
+
+ @since JDK 1.2
+
+ @author Mark Benvenuto
+*/
+public class DSAPublicKeySpec extends Object implements KeySpec
{
- private final BigInteger y;
- private final BigInteger p;
- private final BigInteger q;
- private final BigInteger g;
-
- public DSAPublicKeySpec(BigInteger y,
- BigInteger p,
- BigInteger q,
- BigInteger g)
- {
- /* XXX Are these checks valid? */
- if( y.signum() < 0 )
- throw new IllegalArgumentException();
- if( p.signum() < 0 )
- throw new IllegalArgumentException();
- if( q.signum() < 0 )
- throw new IllegalArgumentException();
- if( g.signum() < 0 )
- throw new IllegalArgumentException();
- this.y = y;
- this.p = p;
- this.q = q;
- this.g = g;
- }
-
- public BigInteger getY()
- {
- return this.y;
- }
-
- public BigInteger getP()
- {
- return this.p;
- }
-
- public BigInteger getQ()
- {
- return this.q;
- }
-
- public BigInteger getG()
- {
- return this.g;
- }
-
- public String toString()
- {
- return "DSAPublicKeySpec[y="
- + this.y
- + "; p="
- + this.p
- + "; q="
- + this.q
- + "; g="
- + this.g
- + "]";
- }
+ private BigInteger y = null;
+ private BigInteger p = null;
+ private BigInteger q = null;
+ private BigInteger g = null;
+
+ /**
+ Constructs a new DSAPublicKeySpec with the specified y, p, q, and g.
+
+ @param y the public key
+ @param p the prime
+ @param q the sub-prime
+ @param g the base
+ */
+ public DSAPublicKeySpec(BigInteger y, BigInteger p, BigInteger q, BigInteger g)
+ {
+ this.y = y;
+ this.p = p;
+ this.q = q;
+ this.g = g;
+ }
+
+ /**
+ Returns public key y for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getY()
+ {
+ return this.y;
+ }
+
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getP()
+ {
+ return this.p;
+ }
+
+ /**
+ Returns p for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getQ()
+ {
+ return this.q;
+ }
+
+ /**
+ Returns g for the DSA algorithm.
+
+ @return Returns the requested BigInteger
+ */
+ public BigInteger getG()
+ {
+ return this.g;
+ }
+
}
Index: kaffe/libraries/javalib/java/security/spec/EncodedKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/EncodedKeySpec.java:1.1 kaffe/libraries/javalib/java/security/spec/EncodedKeySpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/EncodedKeySpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/EncodedKeySpec.java Mon Mar 22 17:00:56 2004
@@ -1,33 +1,85 @@
-/*
- * EncodedKeySpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* EncodedKeySpec.java --- Encoded Key Specificaton class
+ Copyright (C) 1999 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
package java.security.spec;
-public abstract class EncodedKeySpec
- implements KeySpec
+/**
+ Encoded Key Specification class which is used to store
+ byte encoded keys.
+
+ @since JDK 1.2
+
+ @author Mark Benvenuto
+*/
+public abstract class EncodedKeySpec implements KeySpec
{
- private final byte encodedKey[];
-
- public EncodedKeySpec(byte encodedKey[])
- {
- this.encodedKey = encodedKey;
- }
-
- public byte[] getEncoded()
- {
- return this.encodedKey;
- }
- public abstract String getFormat();
+ private byte[] encodedKey;
+
+ /**
+ Constructs a new EncodedKeySpec with the specified encoded key.
+
+ @param encodedKey A key to store
+ */
+ public EncodedKeySpec(byte[] encodedKey)
+ {
+ this.encodedKey = encodedKey;
+ }
+
+ /**
+ Gets the encoded key in byte format.
+
+ @returns the encoded key
+ */
+ public byte[] getEncoded()
+ {
+ return this.encodedKey;
+ }
+
+ /**
+ Returns the name of the key format used.
+
+ This name is the format such as "PKCS#8" or "X.509" which
+ if it matches a Key class name of the same type can be
+ transformed using the apporiate KeyFactory.
+
+ @return a string representing the name
+ */
+ public abstract String getFormat();
+
}
Index: kaffe/libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java:1.1 kaffe/libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/PKCS8EncodedKeySpec.java Mon Mar 22 17:00:56 2004
@@ -1,29 +1,81 @@
-/*
- * PKCS8EncodedKeySpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* PKCS8EncodedKeySpec.java --- PKCS8 Encoded Key Specificaton class
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
package java.security.spec;
-public class PKCS8EncodedKeySpec
- extends EncodedKeySpec
+/**
+ PKCS8 Encoded Key Specification class which is used to store
+ "PKCS#8" byte encoded keys.
+
+ @since JDK 1.2
+
+ @author Mark Benvenuto
+*/
+public class PKCS8EncodedKeySpec extends EncodedKeySpec
{
- public PKCS8EncodedKeySpec(byte encodedKey[])
- {
- super(encodedKey);
- }
-
- public final String getFormat()
- {
- return "PKCS#8";
- }
+ /**
+ Constructs a new PKCS8EncodedKeySpec with the specified encoded key.
+
+ @param encodedKey A key to store, assumed to be "PKCS#8"
+ */
+ public PKCS8EncodedKeySpec(byte[] encodedKey)
+ {
+ super( encodedKey );
+ }
+
+ /**
+ Gets the encoded key in byte format.
+
+ @returns the encoded key
+*/
+ public byte[] getEncoded()
+ {
+ return super.getEncoded();
+ }
+
+ /**
+ Returns the name of the key format used which is "PKCS#8"
+
+ @return a string representing the name
+*/
+ public final String getFormat()
+ {
+ return "PKCS#8";
+ }
+
}
Index: kaffe/libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java
diff -u kaffe/libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java:1.1 kaffe/libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/RSAKeyGenParameterSpec.java Mon Mar 22 17:00:56 2004
@@ -1,52 +1,97 @@
-/*
- * RSAKeyGenParameterSpec.java
- *
- * Copyright (c) 2001 University of Utah and the Flux Group.
- * All rights reserved.
- *
- * This file is licensed under the terms of the GNU Public License.
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Contributed by the Flux Research Group, Department of Computer Science,
- * University of Utah, http://www.cs.utah.edu/flux/
- */
+/* RSAKeyGenParameterSpec.java --- RSA Key Generator Parameter Spec Class
+ Copyright (C) 1999 Free Software Foundation, Inc.
-package java.security.spec;
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.security.spec;
import java.math.BigInteger;
-public class RSAKeyGenParameterSpec
- implements AlgorithmParameterSpec
+/**
+ This class generates a set of RSA Key parameters used in the generation
+ of RSA keys.
+
+ @since JDK 1.3
+
+ @author Mark Benvenuto
+*/
+public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec
{
- public static final BigInteger F0 = new BigInteger("3");
- public static final BigInteger F4 = new BigInteger("65537");
+ private int keysize;
+ private BigInteger publicExponent;
- private final int keysize;
- private final BigInteger publicExponent;
+ /**
+ Public Exponent F0 = 3
+ */
+ public static final BigInteger F0 = new BigInteger("3");
+
+ /**
+ Public Exponent F4 = 3
+ */
+ public static final BigInteger F4 = new BigInteger("65537");
+
+ /**
+ Create a new RSAKeyGenParameterSpec to store the RSA key's keysize
+ and public exponent
+
+ @param keysize Modulus size of key in bits
+ @param publicExponent - the exponent
+ */
+ public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent)
+ {
+ this.keysize = keysize;
+ this.publicExponent = publicExponent;
+ }
- public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent)
- {
- this.keysize = keysize;
- this.publicExponent = publicExponent;
- }
-
- public int getKeysize()
- {
- return this.keysize;
- }
-
- public BigInteger getPublicExponent()
- {
- return this.publicExponent;
- }
-
- public String toString()
- {
- return "RSAKeyGenParameterSpec[keysize="
- + this.keysize
- + "; publicExponent="
- + this.publicExponent
- + "]";
- }
+ /**
+ Return the size of the key.
+
+ @return the size of the key.
+ */
+ public int getKeysize()
+ {
+ return keysize;
+ }
+
+ /**
+ Return the public exponent.
+
+ @return the public exponent.
+ */
+ public BigInteger getPublicExponent()
+ {
+ return publicExponent;
+ }
}
Index: kaffe/libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java:1.2 kaffe/libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java:1.3
--- kaffe/libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java:1.2 Mon Mar 22 11:25:02 2004
+++ kaffe/libraries/javalib/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java Mon Mar 22 17:00:56 2004
@@ -38,6 +38,7 @@
package java.security.spec;
import java.math.BigInteger;
+import java.security.spec.RSAOtherPrimeInfo;
/**
* This class specifies an RSA multi-prime private key, as defined in the
Index: kaffe/libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java
diff -u kaffe/libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java:1.1 kaffe/libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java:1.2
--- kaffe/libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java:1.1 Sun May 12 15:08:45 2002
+++ kaffe/libraries/javalib/java/security/spec/RSAPrivateCrtKeySpec.java Mon Mar 22 17:00:56 2004
*** Patch too long, truncated ***
More information about the kaffe
mailing list