diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2001-09-25 04:30:59 +0000 |
---|---|---|
committer | Bryce McKinlay <mckinlay@redhat.com> | 2001-09-25 04:30:59 +0000 |
commit | fa260dfd99f3e978056ac222a473b11e48db7e68 (patch) | |
tree | 5911416f78fce57f7df3c9801b164b4dc2c4e890 /java/security/interfaces | |
parent | 986e38631eb362bd3c454a0e432be97084a0ec2f (diff) | |
download | classpath-fa260dfd99f3e978056ac222a473b11e48db7e68.tar.gz |
* gnu/java/security/provider/DefaultPolicy.java: New file, from libgcj.
* java/security: Merge from libgcj. These are mostly formatting
fixes, with a few fixes and enhancements.
Diffstat (limited to 'java/security/interfaces')
-rw-r--r-- | java/security/interfaces/DSAKey.java | 35 | ||||
-rw-r--r-- | java/security/interfaces/DSAKeyPairGenerator.java | 88 | ||||
-rw-r--r-- | java/security/interfaces/DSAParams.java | 69 | ||||
-rw-r--r-- | java/security/interfaces/DSAPrivateKey.java | 88 | ||||
-rw-r--r-- | java/security/interfaces/DSAPublicKey.java | 86 | ||||
-rw-r--r-- | java/security/interfaces/RSAKey.java | 13 | ||||
-rw-r--r-- | java/security/interfaces/RSAPrivateCrtKey.java | 120 | ||||
-rw-r--r-- | java/security/interfaces/RSAPrivateKey.java | 35 | ||||
-rw-r--r-- | java/security/interfaces/RSAPublicKey.java | 35 |
9 files changed, 240 insertions, 329 deletions
diff --git a/java/security/interfaces/DSAKey.java b/java/security/interfaces/DSAKey.java index 6d357ae53..1670b5a4d 100644 --- a/java/security/interfaces/DSAKey.java +++ b/java/security/interfaces/DSAKey.java @@ -7,7 +7,7 @@ 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 @@ -24,27 +24,22 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; /** - * This interface is implemented by a class to return the parameters - * of a Digital Signature Algorithm (DSA) public or private key. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface is implemented by a class to return the parameters + * of a Digital Signature Algorithm (DSA) public or private key. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface DSAKey { - -/** - * This method returns non-secret parameters of the DSA key - * - * @return The DSA parameters - */ -public abstract DSAParams -getParams(); - -} // interface DSAKey - + /** + * This method returns non-secret parameters of the DSA key + * + * @return The DSA parameters + */ + public abstract DSAParams getParams(); +} diff --git a/java/security/interfaces/DSAKeyPairGenerator.java b/java/security/interfaces/DSAKeyPairGenerator.java index c0ef6e674..af087e040 100644 --- a/java/security/interfaces/DSAKeyPairGenerator.java +++ b/java/security/interfaces/DSAKeyPairGenerator.java @@ -7,7 +7,7 @@ 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 @@ -24,58 +24,52 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; import java.security.SecureRandom; import java.security.InvalidParameterException; /** - * This interface contains methods for intializing a Digital Signature - * Algorithm key generation engine. The initialize methods may be called - * any number of times. If no explicity initialization call is made, then - * the engine defaults to generating 1024-bit keys using pre-calculated - * base, prime, and subprime values. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface contains methods for intializing a Digital Signature + * Algorithm key generation engine. The initialize methods may be called + * any number of times. If no explicity initialization call is made, then + * the engine defaults to generating 1024-bit keys using pre-calculated + * base, prime, and subprime values. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface DSAKeyPairGenerator { + /** + * Initializes the key generator with the specified DSA parameters and + * random bit source + * + * @param params The DSA parameters to use + * @param random The random bit source to use + * + * @exception InvalidParameterException If the parameters passed are not valid + */ + public abstract void initialize(DSAParams params, SecureRandom random) + throws InvalidParameterException; -/** - * Initializes the key generator with the specified DSA parameters and - * random bit source - * - * @param params The DSA parameters to use - * @param random The random bit source to use - * - * @exception InvalidParameterException If the parameters passed are not valid - */ -public abstract void -initialize(DSAParams params, SecureRandom random) throws InvalidParameterException; - -/*************************************************************************/ - -/** - * Initializes the key generator to a give modulus. If the <code>genParams</code> - * value is <code>true</code> then new base, prime, and subprime values - * will be generated for the given modulus. If not, the pre-calculated - * values will be used. If no pre-calculated values exist for the specified - * modulus, an exception will be thrown. It is guaranteed that there will - * always be pre-calculated values for all modulus values between 512 and - * 1024 bits inclusives. - * - * @param modlen The modulus length - * @param genParams <code>true</code> to generate new DSA parameters, <code>false</code> otherwise - * @param random The random bit source to use - * - * @exception InvalidParameterException If a parameter is invalid - */ -public abstract void -initialize(int modlen, boolean genParams, SecureRandom random) - throws InvalidParameterException; - -} // interface DSAKeyPairGenerator - + /** + * Initializes the key generator to a give modulus. If the <code>genParams</code> + * value is <code>true</code> then new base, prime, and subprime values + * will be generated for the given modulus. If not, the pre-calculated + * values will be used. If no pre-calculated values exist for the specified + * modulus, an exception will be thrown. It is guaranteed that there will + * always be pre-calculated values for all modulus values between 512 and + * 1024 bits inclusives. + * + * @param modlen The modulus length + * @param genParams <code>true</code> to generate new DSA parameters, <code>false</code> otherwise + * @param random The random bit source to use + * + * @exception InvalidParameterException If a parameter is invalid + */ + public abstract void initialize(int modlen, boolean genParams, + SecureRandom random) + throws InvalidParameterException; +} diff --git a/java/security/interfaces/DSAParams.java b/java/security/interfaces/DSAParams.java index 9310efee7..fea3aa8e7 100644 --- a/java/security/interfaces/DSAParams.java +++ b/java/security/interfaces/DSAParams.java @@ -7,7 +7,7 @@ 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 @@ -24,49 +24,38 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; import java.math.BigInteger; /** - * This interface allows the Digital Signature Algorithm (DSA) parameters - * to be queried. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface allows the Digital Signature Algorithm (DSA) parameters + * to be queried. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface DSAParams { - -/** - * Returns the base, or 'g' value - * - * @return The DSA base value - */ -public abstract BigInteger -getG(); - -/*************************************************************************/ - -/** - * Returns the prime, or 'p' value - * - * @return The DSA prime value - */ -public abstract BigInteger -getP(); - -/*************************************************************************/ - -/** - * Returns the subprime, or 'q' value - * - * @return The DSA subprime value - */ -public abstract BigInteger -getQ(); - -} // interface DSAParams - + /** + * Returns the base, or 'g' value + * + * @return The DSA base value + */ + public abstract BigInteger getG(); + + /** + * Returns the prime, or 'p' value + * + * @return The DSA prime value + */ + public abstract BigInteger getP(); + + /** + * Returns the subprime, or 'q' value + * + * @return The DSA subprime value + */ + public abstract BigInteger getQ(); +} diff --git a/java/security/interfaces/DSAPrivateKey.java b/java/security/interfaces/DSAPrivateKey.java index 5df88fac9..70a432d4a 100644 --- a/java/security/interfaces/DSAPrivateKey.java +++ b/java/security/interfaces/DSAPrivateKey.java @@ -1,61 +1,45 @@ -/************************************************************************* -/* DSAPrivateKey.java -- A Digital Signature Algorithm private key -/* -/* Copyright (c) 1998, 2000 Free Software Foundation, Inc. -/* Written by Aaron M. Renn (arenn@urbanophile.com) -/* -/* This library is free software; you can redistribute it and/or modify -/* it under the terms of the GNU Library General Public License as published -/* by the Free Software Foundation, either version 2 of the License, or -/* (at your option) any later verion. -/* -/* This library 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 Library General Public License for more details. -/* -/* You should have received a copy of the GNU Library General Public License -/* along with this library; if not, write to the Free Software Foundation -/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -/*************************************************************************/ +/* DSAPublicKey.java -- A Digital Signature Algorithm private key + Copyright (C) 1998, 2000 Free Software Foundation, Inc. -package java.security.interfaces; +This file is part of GNU Classpath. -import java.security.PrivateKey; -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. -/** - * This interface models a Digital Signature Algorithm (DSA) private key - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface DSAPrivateKey extends DSAKey, PrivateKey -{ - -/*************************************************************************/ +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. -/** - * Static Variables - */ +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. -/** - * This is the serialization UID for this interface - */ -public static final long serialVersionUID = 7776497482533790279L; +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -/*************************************************************************/ +package java.security.interfaces; -/** - * Instance Methods - */ +import java.security.PrivateKey; +import java.math.BigInteger; /** - * This method returns the value of the DSA private key - */ -public abstract BigInteger -getX(); - -} // interface DSAPrivateKey - + * This interface models a Digital Signature Algorithm (DSA) private key + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface DSAPrivateKey extends DSAKey, PrivateKey +{ + /** + * This method returns the value of the DSA private key + */ + public BigInteger getX(); +} diff --git a/java/security/interfaces/DSAPublicKey.java b/java/security/interfaces/DSAPublicKey.java index 1ce165acf..6a2ad8ff3 100644 --- a/java/security/interfaces/DSAPublicKey.java +++ b/java/security/interfaces/DSAPublicKey.java @@ -1,61 +1,45 @@ -/************************************************************************* /* DSAPublicKey.java -- A Digital Signature Algorithm public key -/* -/* Copyright (c) 1998, 2000 Free Software Foundation, Inc. -/* Written by Aaron M. Renn (arenn@urbanophile.com) -/* -/* This library is free software; you can redistribute it and/or modify -/* it under the terms of the GNU Library General Public License as published -/* by the Free Software Foundation, either version 2 of the License, or -/* (at your option) any later verion. -/* -/* This library 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 Library General Public License for more details. -/* -/* You should have received a copy of the GNU Library General Public License -/* along with this library; if not, write to the Free Software Foundation -/* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA -/*************************************************************************/ + Copyright (C) 1998, 2000 Free Software Foundation, Inc. -package java.security.interfaces; +This file is part of GNU Classpath. -import java.security.PublicKey; -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. -/** - * This interface models a Digital Signature Algorithm (DSA) public key - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public interface DSAPublicKey extends DSAKey, PublicKey -{ - -/*************************************************************************/ +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. -/** - * Static Variables - */ +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. -/** - * This is the serialization UID for this interface - */ -public static final long serialVersionUID = 1234526332779022332L; +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -/*************************************************************************/ +package java.security.interfaces; -/** - * Instance Methods - */ +import java.security.PublicKey; +import java.math.BigInteger; /** - * This method returns the value of the DSA public key - */ -public abstract BigInteger -getY(); - -} // interface DSAPublicKey - + * This interface models a Digital Signature Algorithm (DSA) public key + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ +public interface DSAPublicKey extends DSAKey, PublicKey +{ + /** + * This method returns the value of the DSA public key + */ + public BigInteger getY(); +} diff --git a/java/security/interfaces/RSAKey.java b/java/security/interfaces/RSAKey.java index 3302993c9..1233f95f1 100644 --- a/java/security/interfaces/RSAKey.java +++ b/java/security/interfaces/RSAKey.java @@ -7,7 +7,7 @@ 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 @@ -24,22 +24,21 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; /** - A generic RSA Key interface for public and private keys + A generic RSA Key interface for public and private keys - @since JDK 1.3 + @since JDK 1.3 - @author Mark Benvenuto -*/ + @author Mark Benvenuto + */ public interface RSAKey { /** Generates a modulus. @returns a modulus - */ + */ public java.math.BigInteger getModulus(); } diff --git a/java/security/interfaces/RSAPrivateCrtKey.java b/java/security/interfaces/RSAPrivateCrtKey.java index 5e2d74b2d..7e895dc12 100644 --- a/java/security/interfaces/RSAPrivateCrtKey.java +++ b/java/security/interfaces/RSAPrivateCrtKey.java @@ -7,7 +7,7 @@ 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 @@ -24,79 +24,59 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; import java.math.BigInteger; /** - * This interface provides access to information about an RSA private - * key in Chinese Remainder Theorem (CRT) format. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface provides access to information about an RSA private + * key in Chinese Remainder Theorem (CRT) format. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface RSAPrivateCrtKey extends RSAPrivateKey { - -/** - * Returns the public exponent for this key - * - * @return The public exponent for this key - */ -public abstract BigInteger -getPublicExponent(); - -/*************************************************************************/ - -/** - * Returns the primeP value - * - * @return The primeP value - */ -public abstract BigInteger -getPrimeP(); - -/*************************************************************************/ - -/** - * Returns the primeQ value - * - * @return The primeQ value - */ -public abstract BigInteger -getPrimeQ(); - -/*************************************************************************/ - -/** - * Returns the primeExponentP - * - * @return The primeExponentP - */ -public abstract BigInteger -getPrimeExponentP(); - -/*************************************************************************/ - -/** - * Returns the primeExponentQ - * - * @return The primeExponentQ - */ -public abstract BigInteger -getPrimeExponentQ(); - -/*************************************************************************/ - -/** - * Returns the CRT coefficient - * - * @return The CRT coefficient - */ -public abstract BigInteger -getCrtCoefficient(); - -} // interface RSAPrivateCrtKey - + /** + * Returns the public exponent for this key + * + * @return The public exponent for this key + */ + public abstract BigInteger getPublicExponent(); + + /** + * Returns the primeP value + * + * @return The primeP value + */ + public abstract BigInteger getPrimeP(); + + /** + * Returns the primeQ value + * + * @return The primeQ value + */ + public abstract BigInteger getPrimeQ(); + + /** + * Returns the primeExponentP + * + * @return The primeExponentP + */ + public abstract BigInteger getPrimeExponentP(); + + /** + * Returns the primeExponentQ + * + * @return The primeExponentQ + */ + public abstract BigInteger getPrimeExponentQ(); + + /** + * Returns the CRT coefficient + * + * @return The CRT coefficient + */ + public abstract BigInteger getCrtCoefficient(); +} diff --git a/java/security/interfaces/RSAPrivateKey.java b/java/security/interfaces/RSAPrivateKey.java index f56a14c97..f474795fe 100644 --- a/java/security/interfaces/RSAPrivateKey.java +++ b/java/security/interfaces/RSAPrivateKey.java @@ -7,7 +7,7 @@ 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 @@ -24,31 +24,24 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; import java.security.PrivateKey; import java.math.BigInteger; /** - * This interface provides access to information about an RSA private key. - * - * @version 0.1 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface provides access to information about an RSA private key. + * + * @version 0.1 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface RSAPrivateKey extends PrivateKey, RSAKey { - -/*************************************************************************/ - -/** - * Returns the private exponent value for this key - * - * @return The private exponent value for this key - */ -public abstract BigInteger -getPrivateExponent(); - -} // interface RSAPrivateKey - + /** + * Returns the private exponent value for this key + * + * @return The private exponent value for this key + */ + public abstract BigInteger getPrivateExponent(); +} diff --git a/java/security/interfaces/RSAPublicKey.java b/java/security/interfaces/RSAPublicKey.java index a74c940ff..51a555e83 100644 --- a/java/security/interfaces/RSAPublicKey.java +++ b/java/security/interfaces/RSAPublicKey.java @@ -7,7 +7,7 @@ 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 @@ -24,31 +24,24 @@ resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ - package java.security.interfaces; import java.security.PublicKey; import java.math.BigInteger; /** - * This interface provides access to information about an RSA public key. - * - * @version 0.1 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This interface provides access to information about an RSA public key. + * + * @version 0.1 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + */ public interface RSAPublicKey extends PublicKey, RSAKey { - -/*************************************************************************/ - -/** - * Returns the public exponent value for this key - * - * @return The public exponent value for this key - */ -public abstract BigInteger -getPublicExponent(); - -} // interface RSAPublicKey - + /** + * Returns the public exponent value for this key + * + * @return The public exponent value for this key + */ + public abstract BigInteger getPublicExponent(); +} |