Major merge with Classpath.

Removed many duplicate files.
	* HACKING: Updated.x
	* classpath: Imported new directory.
	* standard.omit: New file.
	* Makefile.in, aclocal.m4, configure: Rebuilt.
	* sources.am: New file.
	* configure.ac: Run Classpath configure script.  Moved code around
	to support.  Disable xlib AWT peers (temporarily).
	* Makefile.am (SUBDIRS): Added 'classpath'
	(JAVAC): Removed.
	(AM_CPPFLAGS): Added more -I options.
	(BOOTCLASSPATH): Simplified.
	Completely redid how sources are built.
	Include sources.am.
	* include/Makefile.am (tool_include__HEADERS): Removed jni.h.
	* include/jni.h: Removed (in Classpath).
	* scripts/classes.pl: Updated to look at built classes.
	* scripts/makemake.tcl: New file.
	* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Added
	-I options.
	(gcj_jni_invocation_compile_c_to_binary): Likewise.

From-SVN: r102082
This commit is contained in:
Tom Tromey 2005-07-16 01:27:14 +00:00 committed by Tom Tromey
parent ea54b29342
commit b0fa81eea9
2817 changed files with 11656 additions and 643398 deletions

View file

@ -1,52 +0,0 @@
/* AlgorithmParameterSpec.java --- Algorithm Parameter Spec Interface
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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
A transparent interface for Algorithm Parameter Specifications.
It contains no member functions. It is used to group
algorithm parameter classes.
@since JDK 1.2
@author Mark Benvenuto
*/
public interface AlgorithmParameterSpec
{
}

View file

@ -1,101 +0,0 @@
/* DSAParameterSpec.java --- DSA Parameter Specificaton class
Copyright (C) 1999, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
import java.security.interfaces.DSAParams;
/**
* DSA Parameter class Specification. Used to maintain the DSA
* Parameters.
*
* @since 1.2
*
* @author Mark Benvenuto
*/
public class DSAParameterSpec implements AlgorithmParameterSpec, DSAParams
{
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;
}
}

View file

@ -1,113 +0,0 @@
/* DSAPrivateKeySpec.java --- DSA Private Key Specificaton class
Copyright (C) 1999, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
DSA Private Key class Specification. Used to maintain the DSA
Private Keys.
@since JDK 1.2
@author Mark Benvenuto
*/
public class DSAPrivateKeySpec implements KeySpec
{
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;
}
}

View file

@ -1,113 +0,0 @@
/* DSAPublicKeySpec.java --- DSA Public Key Specificaton class
Copyright (C) 1999, 2004 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
DSA Public Key class Specification. Used to maintain the DSA
Public Keys.
@since JDK 1.2
@author Mark Benvenuto
*/
public class DSAPublicKeySpec implements KeySpec
{
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;
}
}

View file

@ -1,85 +0,0 @@
/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
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 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();
}

View file

@ -1,74 +0,0 @@
/* InvalidKeySpecException.java -- invalid KeySpec Exception
Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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.GeneralSecurityException;
/**
* Exception for an invalid key specification.
*
* @author Mark Benvenuto
* @see KeySpec
* @since 1.2
* @status updated to 1.4
*/
public class InvalidKeySpecException extends GeneralSecurityException
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = 3546139293998810778L;
/**
* Constructs an InvalidKeySpecException without a message string.
*/
public InvalidKeySpecException()
{
}
/**
* Constructs an InvalidKeySpecException with a message string.
*
* @param msg a message to display with exception
*/
public InvalidKeySpecException(String msg)
{
super(msg);
}
}

View file

@ -1,76 +0,0 @@
/* InvalidParameterSpecException.java --- invalid ParameterSpec Exception
Copyright (C) 1999, 2002 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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.GeneralSecurityException;
/**
* Exception for an invalid algorithm specification.
*
* @author Mark Benvenuto
* @see AlogorithmParameters
* @see AlogorithmParameterSpec
* @see DSAParameterSpec
* @since 1.2
* @status updated to 1.4
*/
public class InvalidParameterSpecException extends GeneralSecurityException
{
/**
* Compatible with JDK 1.2+.
*/
private static final long serialVersionUID = -970468769593399342L;
/**
* Constructs an InvalidParameterSpecException without a message string.
*/
public InvalidParameterSpecException()
{
}
/**
* Constructs an InvalidParameterSpecException with a message string.
*
* @param msg a message to display with exception
*/
public InvalidParameterSpecException(String msg)
{
super(msg);
}
}

View file

@ -1,52 +0,0 @@
/* KeySpec.java --- Key Specification interface
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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
A transparent interface for Key Specifications.
It contains no member functions. It is used to group
key classes.
@since JDK 1.2
@author Mark Benvenuto
*/
public interface KeySpec
{
}

View file

@ -1,81 +0,0 @@
/* 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
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
{
/**
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";
}
}

View file

@ -1,90 +0,0 @@
/* PSSParameterSpec.java --
Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
* This class specifies a parameter spec for RSA PSS encoding scheme, as
* defined in the PKCS#1 v2.1.
*
* @since 1.4
* @see AlgorithmParameterSpec
* @see java.security.Signature
*/
public class PSSParameterSpec implements AlgorithmParameterSpec
{
// Constants and fields
// --------------------------------------------------------------------------
private int saltLen;
// Constructor(s)
// --------------------------------------------------------------------------
/**
* Creates a new <code>PSSParameterSpec</code> given the salt length as
* defined in PKCS#1.
*
* @param saltLen the length of salt in bits to be used in PKCS#1 PSS encoding.
* @throws IllegalArgumentException if <code>saltLen</code> is less than
* <code>0</code>.
*/
public PSSParameterSpec(int saltLen)
{
super();
if (saltLen < 0)
throw new IllegalArgumentException();
this.saltLen = saltLen;
}
// Class methods
// --------------------------------------------------------------------------
// Instance methods
// --------------------------------------------------------------------------
/**
* Returns the salt length in bits.
*
* @return the salt length.
*/
public int getSaltLength()
{
return this.saltLen;
}
}

View file

@ -1,97 +0,0 @@
/* RSAKeyGenParameterSpec.java --- RSA Key Generator Parameter Spec 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
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
{
private int keysize;
private 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;
}
/**
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;
}
}

View file

@ -1,217 +0,0 @@
/* PSSParameterSpec.java --
Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
* This class specifies an RSA multi-prime private key, as defined in the
* PKCS#1 v2.1, using the <i>Chinese Remainder Theorem</i> (CRT) information
* values for efficiency.
*
* @since 1.4
* @see java.security.Key
* @see java.security.KeyFactory
* @see KeySpec
* @see PKCS8EncodedKeySpec
* @see RSAPrivateKeySpec
* @see RSAPublicKeySpec
* @see RSAOtherPrimeInfo
*/
public class RSAMultiPrimePrivateCrtKeySpec extends RSAPrivateKeySpec
{
// Constants and fields
// --------------------------------------------------------------------------
private BigInteger publicExponent;
private BigInteger primeP;
private BigInteger primeQ;
private BigInteger primeExponentP;
private BigInteger primeExponentQ;
private BigInteger crtCoefficient;
private RSAOtherPrimeInfo[] otherPrimeInfo;
// Constructor(s)
// --------------------------------------------------------------------------
/**
* <p>Creates a new <code>RSAMultiPrimePrivateCrtKeySpec</code> given the
* modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP,
* primeExponentQ, crtCoefficient, and otherPrimeInfo as defined in PKCS#1
* v2.1.</p>
*
* <p>Note that <code>otherPrimeInfo</code> is cloned when constructing this
* object.</p>
*
* @param modulus the modulus n.
* @param publicExponent the public exponent e.
* @param privateExponent the private exponent d.
* @param primeP the prime factor p of n.
* @param primeQ the prime factor q of n.
* @param primeExponentP this is d mod (p-1).
* @param primeExponentQ this is d mod (q-1).
* @param crtCoefficient the Chinese Remainder Theorem coefficient q-1 mod p.
* @param otherPrimeInfo triplets of the rest of primes, <code>null</code>
* can be specified if there are only two prime factors (p and q).
* @throws NullPointerException if any of the parameters, i.e. modulus,
* publicExponent, privateExponent, primeP, primeQ, primeExponentP,
* primeExponentQ, crtCoefficient, is <code>null</code>.
* @throws IllegalArgumentException if an empty, i.e. 0-length,
* otherPrimeInfo is specified.
*/
public RSAMultiPrimePrivateCrtKeySpec(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger primeExponentP,
BigInteger primeExponentQ,
BigInteger crtCoefficient,
RSAOtherPrimeInfo[] otherPrimeInfo)
{
super(modulus, privateExponent);
if (modulus == null)
throw new NullPointerException("modulus");
if (publicExponent == null)
throw new NullPointerException("publicExponent");
if (privateExponent == null)
throw new NullPointerException("privateExponent");
if (primeP == null)
throw new NullPointerException("primeP");
if (primeQ == null)
throw new NullPointerException("primeQ");
if (primeExponentP == null)
throw new NullPointerException("primeExponentP");
if (primeExponentQ == null)
throw new NullPointerException("primeExponentQ");
if (crtCoefficient == null)
throw new NullPointerException("crtCoefficient");
if (otherPrimeInfo != null)
if (otherPrimeInfo.length == 0)
throw new IllegalArgumentException();
else
this.otherPrimeInfo = (RSAOtherPrimeInfo[]) otherPrimeInfo.clone();
this.publicExponent = publicExponent;
this.primeP = primeP;
this.primeQ = primeQ;
this.primeExponentP = primeExponentP;
this.primeExponentQ = primeExponentQ;
this.crtCoefficient = crtCoefficient;
}
// Class methods
// --------------------------------------------------------------------------
// Instance methods
// --------------------------------------------------------------------------
/**
* Returns the public exponent.
*
* @return the public exponent.
*/
public BigInteger getPublicExponent()
{
return this.publicExponent;
}
/**
* Returns the primeP.
*
* @return the primeP.
*/
public BigInteger getPrimeP()
{
return this.primeP;
}
/**
* Returns the primeQ.
*
* @return the primeQ.
*/
public BigInteger getPrimeQ()
{
return this.primeQ;
}
/**
* Returns the primeExponentP.
*
* @return the primeExponentP.
*/
public BigInteger getPrimeExponentP()
{
return this.primeExponentP;
}
/**
* Returns the primeExponentQ.
*
* @return the primeExponentQ.
*/
public BigInteger getPrimeExponentQ()
{
return this.primeExponentQ;
}
/**
* Returns the crtCoefficient.
*
* @return the crtCoefficient.
*/
public BigInteger getCrtCoefficient()
{
return this.crtCoefficient;
}
/**
* Returns a copy of the otherPrimeInfo or <code>null</code> if there are
* only two prime factors (p and q).
*
* @return the otherPrimeInfo.
*/
public RSAOtherPrimeInfo[] getOtherPrimeInfo()
{
return this.otherPrimeInfo == null
? null
: (RSAOtherPrimeInfo[]) this.otherPrimeInfo.clone();
}
}

View file

@ -1,133 +0,0 @@
/* RSAOtherPrimeInfo.java --
Copyright (C) 2003, 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
* This class represents the triplet (prime, exponent, and coefficient) inside
* RSA's OtherPrimeInfo structure, as defined in the PKCS#1 v2.1. The ASN.1
* syntax of RSA's OtherPrimeInfo is as follows:
*
* <pre>
* OtherPrimeInfo ::= SEQUENCE {
* prime INTEGER,
* exponent INTEGER,
* coefficient INTEGER
* }
* </pre>
*
* @since 1.4
* @see RSAPrivateCrtKeySpec
* @see java.security.interfaces.RSAMultiPrimePrivateCrtKey
*/
public class RSAOtherPrimeInfo
{
// Constants and fields
// --------------------------------------------------------------------------
private BigInteger prime;
private BigInteger primeExponent;
private BigInteger crtCoefficient;
// Constructor(s)
// --------------------------------------------------------------------------
/**
* Creates a new <code>RSAOtherPrimeInfo</code> given the prime,
* primeExponent, and crtCoefficient as defined in PKCS#1.
*
* @param prime the prime factor of n.
* @param primeExponent the exponent.
* @param crtCoefficient the Chinese Remainder Theorem coefficient.
* @throws NullPointerException if any of the parameters, i.e. prime,
* primeExponent, crtCoefficient, is <code>null</code>.
*/
public RSAOtherPrimeInfo(BigInteger prime, BigInteger primeExponent,
BigInteger crtCoefficient)
{
super();
if (prime == null)
throw new NullPointerException("prime");
if (primeExponent == null)
throw new NullPointerException("primeExponent");
if (crtCoefficient == null)
throw new NullPointerException("crtCoefficient");
this.prime = prime;
this.primeExponent = primeExponent;
this.crtCoefficient = crtCoefficient;
}
// Class methods
// --------------------------------------------------------------------------
// Instance methods
// --------------------------------------------------------------------------
/**
* Returns the prime.
*
* @return the prime.
*/
public final BigInteger getPrime()
{
return this.prime;
}
/**
* Returns the prime's exponent.
*
* @return the primeExponent.
*/
public final BigInteger getExponent()
{
return this.primeExponent;
}
/**
* Returns the prime's crtCoefficient.
*
* @return the crtCoefficient.
*/
public final BigInteger getCrtCoefficient()
{
return this.crtCoefficient;
}
}

View file

@ -1,151 +0,0 @@
/* RSAPrivateCrtKeySpec.java --- RSA Private Certificate 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
RSA Private Certificate Key class Specification. Used to
maintain the RSA Private Certificate Keys with the
<I>Chinese Remainder Theorem</I>(CRT) as specified by PKCS#1.
@since JDK 1.2
@author Mark Benvenuto
*/
public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec
{
private BigInteger publicExponent;
private BigInteger primeP;
private BigInteger primeQ;
private BigInteger primeExponentP;
private BigInteger primeExponentQ;
private BigInteger crtCoefficient;
/**
Constructs a new RSAPrivateKeySpec with the specified
variables.
@param modulus the RSA modulus
@param publicExponent the public key exponent
@param privateExponent the private key exponent
@param primeP the prime P
@param primeQ the prime Q
@param primeExponentP the prime exponent P
@param primeExponentQ the prime exponent P
@param crtCoefficient the CRT coefficient
*/
public RSAPrivateCrtKeySpec(BigInteger modulus,
BigInteger publicExponent,
BigInteger privateExponent,
BigInteger primeP,
BigInteger primeQ,
BigInteger primeExponentP,
BigInteger primeExponentQ,
BigInteger crtCoefficient)
{
super( modulus, privateExponent);
this.publicExponent = publicExponent;
this.primeP = primeP;
this.primeQ = primeQ;
this.primeExponentP = primeExponentP;
this.primeExponentQ = primeExponentQ;
this.crtCoefficient = crtCoefficient;
}
/**
Gets the RSA public exponent.
@return the RSA public exponent
*/
public BigInteger getPublicExponent()
{
return this.publicExponent;
}
/**
Gets the RSA prime P.
@return the RSA prime P
*/
public BigInteger getPrimeP()
{
return this.primeP;
}
/**
Gets the RSA prime Q.
@return the RSA prime Q
*/
public BigInteger getPrimeQ()
{
return this.primeQ;
}
/**
Gets the RSA prime exponent P.
@return the RSA prime exponent P
*/
public BigInteger getPrimeExponentP()
{
return this.primeExponentP;
}
/**
Gets the RSA prime exponent P.
@return the RSA prime exponent Q
*/
public BigInteger getPrimeExponentQ()
{
return this.primeExponentQ;
}
/**
Gets the RSA CRT coefficient.
@return the RSA CRT coefficient
*/
public BigInteger getCrtCoefficient()
{
return this.crtCoefficient;
}
}

View file

@ -1,88 +0,0 @@
/* RSAPrivateKeySpec.java --- RSA Private 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
RSA Private Key class Specification. Used to maintain the RSA
Private Keys.
@since JDK 1.2
@author Mark Benvenuto
*/
public class RSAPrivateKeySpec implements KeySpec
{
private BigInteger modulus;
private BigInteger privateExponent;
/**
Constructs a new RSAPrivateKeySpec with the specified
modulus and privateExponent.
@param modulus the RSA modulus
@param privateExponent the private key exponent
*/
public RSAPrivateKeySpec(BigInteger modulus, BigInteger privateExponent)
{
this.modulus = modulus;
this.privateExponent = privateExponent;
}
/**
Gets the RSA modulus.
@return the RSA modulus
*/
public BigInteger getModulus()
{
return this.modulus;
}
/**
Gets the RSA private exponent.
@return the RSA private exponent
*/
public BigInteger getPrivateExponent()
{
return this.privateExponent;
}
}

View file

@ -1,88 +0,0 @@
/* RSAPublicKeySpec.java --- RSA Public 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
RSA Public Key class Specification. Used to maintain the RSA
Public Keys.
@since JDK 1.2
@author Mark Benvenuto
*/
public class RSAPublicKeySpec implements KeySpec
{
private BigInteger modulus;
private BigInteger publicExponent;
/**
Constructs a new RSAPublicKeySpec with the specified
modulus and publicExponent.
@param modulus the RSA modulus
@param publicExponent the public key exponent
*/
public RSAPublicKeySpec(BigInteger modulus, BigInteger publicExponent)
{
this.modulus = modulus;
this.publicExponent = publicExponent;
}
/**
Gets the RSA modulus.
@return the RSA modulus
*/
public BigInteger getModulus()
{
return this.modulus;
}
/**
Gets the RSA public exponent.
@return the RSA public exponent
*/
public BigInteger getPublicExponent()
{
return this.publicExponent;
}
}

View file

@ -1,82 +0,0 @@
/* X509EncodedKeySpec.java --- X.509 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., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 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;
/**
X.509 Encoded Key Specification class which is used to store
"X.509" byte encoded keys.
@since JDK 1.2
@author Mark Benvenuto
*/
public class X509EncodedKeySpec extends EncodedKeySpec
{
/**
Constructs a new X509EncodedKeySpec with the specified encoded key.
@param encodedKey A key to store, assumed to be "X.509"
*/
public X509EncodedKeySpec(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 "X.509"
@return a string representing the name
*/
public final String getFormat()
{
return "X.509";
}
}