mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-22 14:29:44 +08:00
AlgorithmParameterGenerator.java, [...]: Import cleanup.
2004-10-21 Michael Koch <konqueror@gmx.de> * java/security/AlgorithmParameterGenerator.java, java/security/AlgorithmParameters.java, java/security/AlgorithmParametersSpi.java, java/security/AllPermission.java, java/security/BasicPermission.java, java/security/Certificate.java, java/security/CodeSource.java, java/security/DigestInputStream.java, java/security/DigestOutputStream.java, java/security/GuardedObject.java, java/security/KeyFactory.java, java/security/KeyFactorySpi.java, java/security/KeyPairGenerator.java, java/security/KeyStore.java, java/security/KeyStoreSpi.java, java/security/Permissions.java, java/security/Security.java, java/security/Signature.java, java/security/UnresolvedPermission.java, java/security/cert/CertPathBuilder.java, java/security/cert/CertPathValidator.java, java/security/cert/CertStore.java, java/security/cert/Certificate.java, java/security/cert/CertificateFactory.java, java/security/cert/PolicyQualifierInfo.java, java/security/cert/TrustAnchor.java, java/security/cert/X509CRL.java, java/security/cert/X509CRLSelector.java, java/security/cert/X509CertSelector.java: Import cleanup. From-SVN: r89397
This commit is contained in:
parent
02db0fc1ce
commit
78fe42c391
@ -1,3 +1,36 @@
|
||||
2004-10-21 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* java/security/AlgorithmParameterGenerator.java,
|
||||
java/security/AlgorithmParameters.java,
|
||||
java/security/AlgorithmParametersSpi.java,
|
||||
java/security/AllPermission.java,
|
||||
java/security/BasicPermission.java,
|
||||
java/security/Certificate.java,
|
||||
java/security/CodeSource.java,
|
||||
java/security/DigestInputStream.java,
|
||||
java/security/DigestOutputStream.java,
|
||||
java/security/GuardedObject.java,
|
||||
java/security/KeyFactory.java,
|
||||
java/security/KeyFactorySpi.java,
|
||||
java/security/KeyPairGenerator.java,
|
||||
java/security/KeyStore.java,
|
||||
java/security/KeyStoreSpi.java,
|
||||
java/security/Permissions.java,
|
||||
java/security/Security.java,
|
||||
java/security/Signature.java,
|
||||
java/security/UnresolvedPermission.java,
|
||||
java/security/cert/CertPathBuilder.java,
|
||||
java/security/cert/CertPathValidator.java,
|
||||
java/security/cert/CertStore.java,
|
||||
java/security/cert/Certificate.java,
|
||||
java/security/cert/CertificateFactory.java,
|
||||
java/security/cert/PolicyQualifierInfo.java,
|
||||
java/security/cert/TrustAnchor.java,
|
||||
java/security/cert/X509CRL.java,
|
||||
java/security/cert/X509CRLSelector.java,
|
||||
java/security/cert/X509CertSelector.java:
|
||||
Import cleanup.
|
||||
|
||||
2004-10-21 Michael Koch <konqueror@gmx.de>
|
||||
|
||||
* java/rmi/MarshalledObject.java,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* AlgorithmParameterGenerator.java --- Algorithm Parameter Generator
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,12 +35,13 @@ 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;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
/**
|
||||
* <p>The <code>AlgorithmParameterGenerator</code> class is used to generate a
|
||||
* set of parameters to be used with a certain algorithm. Parameter generators
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* AlgorithmParameters.java --- Algorithm Parameters Implementation Class
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,14 +35,15 @@ 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;
|
||||
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.io.IOException;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
|
||||
/**
|
||||
* <p>This class is used as an opaque representation of cryptographic
|
||||
* parameters.</p>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* AlgorithmParametersSpi.java --- Algorithm Parameters SPI
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,79 +35,83 @@ 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;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
|
||||
/**
|
||||
AlgorithmParametersSpi is the Service Provider Interface
|
||||
for the Algorithm Parameters class. This class is used
|
||||
to manage the algorithm parameters.
|
||||
|
||||
@since JDK 1.2
|
||||
@author Mark Benvenuto
|
||||
* AlgorithmParametersSpi is the Service Provider Interface
|
||||
* for the Algorithm Parameters class. This class is used
|
||||
* to manage the algorithm parameters.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Mark Benvenuto
|
||||
*/
|
||||
public abstract class AlgorithmParametersSpi
|
||||
{
|
||||
/**
|
||||
Creates a new instance of AlgorithmParametersSpi
|
||||
* Creates a new instance of AlgorithmParametersSpi
|
||||
*/
|
||||
public AlgorithmParametersSpi()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Initializes the engine with the specified
|
||||
AlgorithmParameterSpec class.
|
||||
|
||||
@param paramSpec A AlgorithmParameterSpec to initialize with
|
||||
|
||||
@throws InvalidParameterSpecException For an inapporiate ParameterSpec class
|
||||
* Initializes the engine with the specified
|
||||
* AlgorithmParameterSpec class.
|
||||
*
|
||||
* @param paramSpec A AlgorithmParameterSpec to initialize with
|
||||
*
|
||||
* @throws InvalidParameterSpecException For an inapporiate
|
||||
* ParameterSpec class
|
||||
*/
|
||||
protected abstract void engineInit(AlgorithmParameterSpec paramSpec) throws
|
||||
InvalidParameterSpecException;
|
||||
protected abstract void engineInit(AlgorithmParameterSpec paramSpec)
|
||||
throws InvalidParameterSpecException;
|
||||
|
||||
/**
|
||||
Initializes the engine with the specified
|
||||
parameters stored in the byte array and decodes them
|
||||
according to the ASN.1 specification. If the ASN.1
|
||||
specification exists then it succeeds or else it throws
|
||||
IOException.
|
||||
|
||||
@param params Parameters to initialize with
|
||||
|
||||
@throws IOException Decoding Error
|
||||
* Initializes the engine with the specified
|
||||
* parameters stored in the byte array and decodes them
|
||||
* according to the ASN.1 specification. If the ASN.1
|
||||
* specification exists then it succeeds or else it throws
|
||||
* IOException.
|
||||
*
|
||||
* @param params Parameters to initialize with
|
||||
*
|
||||
* @throws IOException Decoding Error
|
||||
*/
|
||||
protected abstract void engineInit(byte[]params) throws IOException;
|
||||
|
||||
/**
|
||||
Initializes the engine with the specified
|
||||
parameters stored in the byte array and decodes them
|
||||
according to the specified decoding specification.
|
||||
If format is null, then it is decoded using the ASN.1
|
||||
specification if it exists or else it throws
|
||||
IOException.
|
||||
|
||||
@param params Parameters to initialize with
|
||||
@param format Name of decoding format to use
|
||||
|
||||
@throws IOException Decoding Error
|
||||
* Initializes the engine with the specified
|
||||
* parameters stored in the byte array and decodes them
|
||||
* according to the specified decoding specification.
|
||||
* If format is null, then it is decoded using the ASN.1
|
||||
* specification if it exists or else it throws
|
||||
* IOException.
|
||||
*
|
||||
* @param params Parameters to initialize with
|
||||
* @param format Name of decoding format to use
|
||||
*
|
||||
* @throws IOException Decoding Error
|
||||
*/
|
||||
protected abstract void engineInit(byte[]params,
|
||||
String format) throws IOException;
|
||||
protected abstract void engineInit(byte[]params, String format)
|
||||
throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
Returns a specification of this AlgorithmParameters object.
|
||||
paramSpec identifies the class to return the AlgortihmParameters
|
||||
in.
|
||||
|
||||
@param paramSpec Class to return AlgorithmParameters in
|
||||
|
||||
@return the parameter specification
|
||||
|
||||
@throws InvalidParameterSpecException if the paramSpec is an invalid parameter class
|
||||
* Returns a specification of this AlgorithmParameters object.
|
||||
* paramSpec identifies the class to return the AlgortihmParameters
|
||||
* in.
|
||||
*
|
||||
* @param paramSpec Class to return AlgorithmParameters in
|
||||
*
|
||||
* @return the parameter specification
|
||||
*
|
||||
* @throws InvalidParameterSpecException if the paramSpec is an
|
||||
* invalid parameter class
|
||||
*/
|
||||
protected abstract AlgorithmParameterSpec engineGetParameterSpec(Class
|
||||
paramSpec)
|
||||
@ -115,31 +119,31 @@ public abstract class AlgorithmParametersSpi
|
||||
|
||||
|
||||
/**
|
||||
Returns the parameters in the default encoding format.
|
||||
The primary encoding format is ASN.1 format if it exists
|
||||
for the specified type.
|
||||
|
||||
@return byte array representing the parameters
|
||||
* Returns the parameters in the default encoding format.
|
||||
* The primary encoding format is ASN.1 format if it exists
|
||||
* for the specified type.
|
||||
*
|
||||
* @return byte array representing the parameters
|
||||
*/
|
||||
protected abstract byte[] engineGetEncoded() throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
Returns the parameters in the specified encoding format.
|
||||
If <code>format</code> is <code>null</code> then the
|
||||
primary encoding format is used, the ASN.1 format,
|
||||
if it exists for the specified type.
|
||||
|
||||
@return byte array representing the parameters
|
||||
* Returns the parameters in the specified encoding format.
|
||||
* If <code>format</code> is <code>null</code> then the
|
||||
* primary encoding format is used, the ASN.1 format,
|
||||
* if it exists for the specified type.
|
||||
*
|
||||
* @return byte array representing the parameters
|
||||
*/
|
||||
protected abstract byte[] engineGetEncoded(String format) throws
|
||||
IOException;
|
||||
protected abstract byte[] engineGetEncoded(String format)
|
||||
throws IOException;
|
||||
|
||||
/**
|
||||
Returns a string describing the parameters in the
|
||||
AlgorithmParametersSpi class.
|
||||
|
||||
@return A string representing the format of the parameters.
|
||||
* Returns a string describing the parameters in the
|
||||
* AlgorithmParametersSpi class.
|
||||
*
|
||||
* @return A string representing the format of the parameters.
|
||||
*/
|
||||
protected abstract String engineToString();
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* AllPermission.java -- Permission to do anything
|
||||
Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,19 +35,21 @@ 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;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.Collections;
|
||||
import gnu.java.util.EmptyEnumeration;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* This class is a permission that implies all other permissions. Granting
|
||||
* this permission effectively grants all others. Extreme caution should
|
||||
* be exercised in granting this permission.
|
||||
*
|
||||
* @author Aaron M. Renn <arenn@urbanophile.com>
|
||||
* @author Eric Blake <ebb9@email.byu.edu>
|
||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||
* @author Eric Blake (ebb9@email.byu.edu)
|
||||
* @see AccessController
|
||||
* @see Permissions
|
||||
* @see SecurityManager
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* BasicPermission.java -- implements a simple named permission
|
||||
Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,11 +35,12 @@ 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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
|
||||
/**
|
||||
* This class implements a simple model for named permissions without an
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Certificate.java -- deprecated interface for modeling digital certificates
|
||||
Copyright (C) 1998, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,9 +38,9 @@ exception statement from your version. */
|
||||
|
||||
package java.security;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* This interface models a digital certificate which verifies the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* CodeSource.java -- Code location and certifcates
|
||||
Copyright (C) 1998, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -43,13 +43,13 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
import java.net.URL;
|
||||
import java.net.SocketPermission;
|
||||
import java.net.URL;
|
||||
// Note that this overrides Certificate in this package.
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.CertificateEncodingException;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@ -59,8 +59,8 @@ import java.util.Iterator;
|
||||
* represented by a URL), and the list of certificates that are used to
|
||||
* check the signatures of signed code loaded from this source.
|
||||
*
|
||||
* @author Aaron M. Renn <arenn@urbanophile.com>
|
||||
* @author Eric Blake <ebb9@email.byu.edu>
|
||||
* @author Aaron M. Renn (arenn@urbanophile.com)
|
||||
* @author Eric Blake (ebb9@email.byu.edu)
|
||||
* @since 1.1
|
||||
* @status updated to 1.4
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* DigestInputStream.java --- An Input stream tied to a message digest
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,28 +35,29 @@ 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;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
DigestInputStream is a class that ties an InputStream with a
|
||||
MessageDigest. The Message Digest is used by the class to
|
||||
update it self as bytes are read from the InputStream.
|
||||
|
||||
The updating to the digest depends on the on flag which is set
|
||||
to true by default to tell the class to update the data
|
||||
in the message digest.
|
||||
|
||||
@version 0.0
|
||||
@author Mark Benvenuto <ivymccough@worldnet.att.net>
|
||||
* DigestInputStream is a class that ties an InputStream with a
|
||||
* MessageDigest. The Message Digest is used by the class to
|
||||
* update it self as bytes are read from the InputStream.
|
||||
*
|
||||
* The updating to the digest depends on the on flag which is set
|
||||
* to true by default to tell the class to update the data
|
||||
* in the message digest.
|
||||
*
|
||||
* @version 0.0
|
||||
* @author Mark Benvenuto <ivymccough@worldnet.att.net>
|
||||
*/
|
||||
public class DigestInputStream extends FilterInputStream
|
||||
{
|
||||
/**
|
||||
The message digest for the DigestInputStream
|
||||
* The message digest for the DigestInputStream
|
||||
*/
|
||||
protected MessageDigest digest;
|
||||
|
||||
@ -64,12 +65,12 @@ public class DigestInputStream extends FilterInputStream
|
||||
private boolean state = true;
|
||||
|
||||
/**
|
||||
Constructs a new DigestInputStream.
|
||||
It associates a MessageDigest with the stream to
|
||||
compute the stream as data is written.
|
||||
|
||||
@param stream An InputStream to associate this stream with
|
||||
@param digest A MessageDigest to hash the stream with
|
||||
* Constructs a new DigestInputStream.
|
||||
* It associates a MessageDigest with the stream to
|
||||
* compute the stream as data is written.
|
||||
*
|
||||
* @param stream An InputStream to associate this stream with
|
||||
* @param digest A MessageDigest to hash the stream with
|
||||
*/
|
||||
public DigestInputStream(InputStream stream, MessageDigest digest)
|
||||
{
|
||||
@ -79,9 +80,9 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the MessageDigest associated with this DigestInputStream
|
||||
|
||||
@return The MessageDigest used to hash this stream
|
||||
* Returns the MessageDigest associated with this DigestInputStream
|
||||
*
|
||||
* @return The MessageDigest used to hash this stream
|
||||
*/
|
||||
public MessageDigest getMessageDigest()
|
||||
{
|
||||
@ -89,9 +90,9 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the current MessageDigest to current parameter
|
||||
|
||||
@param digest A MessageDigest to associate with this stream
|
||||
* Sets the current MessageDigest to current parameter
|
||||
*
|
||||
* @param digest A MessageDigest to associate with this stream
|
||||
*/
|
||||
public void setMessageDigest(MessageDigest digest)
|
||||
{
|
||||
@ -99,15 +100,15 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Reads a byte from the input stream and updates the digest.
|
||||
This method reads the underlying input stream and if the
|
||||
on flag is true then updates the message digest.
|
||||
|
||||
@return Returns a byte from the input stream, -1 is returned to indicate that
|
||||
the end of stream was reached before this read call
|
||||
|
||||
@throws IOException if an IO error occurs in the underlying input stream,
|
||||
this error is thrown
|
||||
* Reads a byte from the input stream and updates the digest.
|
||||
* This method reads the underlying input stream and if the
|
||||
* on flag is true then updates the message digest.
|
||||
*
|
||||
* @return Returns a byte from the input stream, -1 is returned to indicate that
|
||||
* the end of stream was reached before this read call
|
||||
*
|
||||
* @throws IOException if an IO error occurs in the underlying input stream,
|
||||
* this error is thrown
|
||||
*/
|
||||
public int read() throws IOException
|
||||
{
|
||||
@ -120,18 +121,18 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Reads bytes from the input stream and updates the digest.
|
||||
This method reads the underlying input stream and if the
|
||||
on flag is true then updates the message digest.
|
||||
|
||||
@param b a byte array to store the data from the input stream
|
||||
@param off an offset to start at in the array
|
||||
@param len length of data to read
|
||||
@return Returns count of bytes read, -1 is returned to indicate that
|
||||
the end of stream was reached before this read call
|
||||
|
||||
@throws IOException if an IO error occurs in the underlying input stream,
|
||||
this error is thrown
|
||||
* Reads bytes from the input stream and updates the digest.
|
||||
* This method reads the underlying input stream and if the
|
||||
* on flag is true then updates the message digest.
|
||||
*
|
||||
* @param b a byte array to store the data from the input stream
|
||||
* @param off an offset to start at in the array
|
||||
* @param len length of data to read
|
||||
* @return Returns count of bytes read, -1 is returned to indicate that
|
||||
* the end of stream was reached before this read call
|
||||
*
|
||||
* @throws IOException if an IO error occurs in the underlying input stream,
|
||||
* this error is thrown
|
||||
*/
|
||||
public int read(byte[]b, int off, int len) throws IOException
|
||||
{
|
||||
@ -144,10 +145,10 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the flag specifing if this DigestInputStream updates the
|
||||
digest in the write() methods. The default is on;
|
||||
|
||||
@param on True means it digests stream, false means it does not
|
||||
* Sets the flag specifing if this DigestInputStream updates the
|
||||
* digest in the write() methods. The default is on;
|
||||
*
|
||||
* @param on True means it digests stream, false means it does not
|
||||
*/
|
||||
public void on(boolean on)
|
||||
{
|
||||
@ -155,9 +156,9 @@ public class DigestInputStream extends FilterInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Converts the input stream and underlying message digest to a string.
|
||||
|
||||
@return A string representing the input stream and message digest.
|
||||
* Converts the input stream and underlying message digest to a string.
|
||||
*
|
||||
* @return A string representing the input stream and message digest.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* DigestOutputStream.java --- An output stream tied to a message digest
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,28 +35,29 @@ 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;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
/**
|
||||
DigestOutputStream is a class that ties an OutputStream with a
|
||||
MessageDigest. The Message Digest is used by the class to update it
|
||||
self as bytes are written to the OutputStream.
|
||||
|
||||
The updating to the digest depends on the on flag which is set to
|
||||
true by default that tells the class to update the data in the
|
||||
message digest.
|
||||
|
||||
@version 0.0
|
||||
@author Mark Benvenuto <ivymccough@worldnet.att.net>
|
||||
* DigestOutputStream is a class that ties an OutputStream with a
|
||||
* MessageDigest. The Message Digest is used by the class to update it
|
||||
* self as bytes are written to the OutputStream.
|
||||
*
|
||||
* The updating to the digest depends on the on flag which is set to
|
||||
* true by default that tells the class to update the data in the
|
||||
* message digest.
|
||||
*
|
||||
* @version 0.0
|
||||
* @author Mark Benvenuto <ivymccough@worldnet.att.net>
|
||||
*/
|
||||
public class DigestOutputStream extends FilterOutputStream
|
||||
{
|
||||
/**
|
||||
The message digest for the DigestOutputStream
|
||||
* The message digest for the DigestOutputStream
|
||||
*/
|
||||
protected MessageDigest digest;
|
||||
|
||||
@ -64,12 +65,12 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
private boolean state = true;
|
||||
|
||||
/**
|
||||
Constructs a new DigestOutputStream. It associates a
|
||||
MessageDigest with the stream to compute the stream as data is
|
||||
written.
|
||||
|
||||
@param stream An OutputStream to associate this stream with
|
||||
@param digest A MessageDigest to hash the stream with
|
||||
* Constructs a new DigestOutputStream. It associates a
|
||||
* MessageDigest with the stream to compute the stream as data is
|
||||
* written.
|
||||
*
|
||||
* @param stream An OutputStream to associate this stream with
|
||||
* @param digest A MessageDigest to hash the stream with
|
||||
*/
|
||||
public DigestOutputStream(OutputStream stream, MessageDigest digest)
|
||||
{
|
||||
@ -78,9 +79,9 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the MessageDigest associated with this DigestOutputStream
|
||||
|
||||
@return The MessageDigest used to hash this stream
|
||||
* Returns the MessageDigest associated with this DigestOutputStream
|
||||
*
|
||||
* @return The MessageDigest used to hash this stream
|
||||
*/
|
||||
public MessageDigest getMessageDigest()
|
||||
{
|
||||
@ -88,9 +89,9 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the current MessageDigest to current parameter
|
||||
|
||||
@param digest A MessageDigest to associate with this stream
|
||||
* Sets the current MessageDigest to current parameter
|
||||
*
|
||||
* @param digest A MessageDigest to associate with this stream
|
||||
*/
|
||||
public void setMessageDigest(MessageDigest digest)
|
||||
{
|
||||
@ -99,13 +100,13 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
|
||||
|
||||
/**
|
||||
Updates the hash if the on flag is true and then writes a byte to
|
||||
the underlying output stream.
|
||||
|
||||
@param b A byte to write to the output stream
|
||||
|
||||
@exception IOException if the underlying output stream
|
||||
cannot write the byte, this is thrown.
|
||||
* Updates the hash if the on flag is true and then writes a byte to
|
||||
* the underlying output stream.
|
||||
*
|
||||
* @param b A byte to write to the output stream
|
||||
*
|
||||
* @exception IOException if the underlying output stream
|
||||
* cannot write the byte, this is thrown.
|
||||
*/
|
||||
public void write(int b) throws IOException
|
||||
{
|
||||
@ -116,15 +117,15 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Updates the hash if the on flag is true and then writes the bytes
|
||||
to the underlying output stream.
|
||||
|
||||
@param b Bytes to write to the output stream
|
||||
@param off Offset to start to start at in array
|
||||
@param len Length of data to write
|
||||
|
||||
@exception IOException if the underlying output stream
|
||||
cannot write the bytes, this is thrown.
|
||||
* Updates the hash if the on flag is true and then writes the bytes
|
||||
* to the underlying output stream.
|
||||
*
|
||||
* @param b Bytes to write to the output stream
|
||||
* @param off Offset to start to start at in array
|
||||
* @param len Length of data to write
|
||||
*
|
||||
* @exception IOException if the underlying output stream
|
||||
* cannot write the bytes, this is thrown.
|
||||
*/
|
||||
public void write(byte[]b, int off, int len) throws IOException
|
||||
{
|
||||
@ -135,10 +136,10 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Sets the flag specifying if this DigestOutputStream updates the
|
||||
digest in the write() methods. The default is on;
|
||||
|
||||
@param on True means it digests stream, false means it does not
|
||||
* Sets the flag specifying if this DigestOutputStream updates the
|
||||
* digest in the write() methods. The default is on;
|
||||
*
|
||||
* @param on True means it digests stream, false means it does not
|
||||
*/
|
||||
public void on(boolean on)
|
||||
{
|
||||
@ -146,9 +147,9 @@ public class DigestOutputStream extends FilterOutputStream
|
||||
}
|
||||
|
||||
/**
|
||||
Converts the output stream and underlying message digest to a string.
|
||||
|
||||
@return A string representing the output stream and message digest.
|
||||
* Converts the output stream and underlying message digest to a string.
|
||||
*
|
||||
* @return A string representing the output stream and message digest.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* GuardedObject.java -- An object protected by a Guard
|
||||
Copyright (C) 1998, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,11 +35,12 @@ 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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* This class is an object that is guarded by a <code>Guard</code> object.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* KeyFactory.java --- Key Factory Class
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,13 +35,14 @@ 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;
|
||||
|
||||
import java.security.spec.KeySpec;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.KeySpec;
|
||||
|
||||
/**
|
||||
* <p>Key factories are used to convert keys (opaque cryptographic keys of type
|
||||
* {@link Key}) into key specifications (transparent representations of the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* KeyFactorySpi.java --- Key Factory Service Provider Interface
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,96 +35,98 @@ 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;
|
||||
import java.security.spec.KeySpec;
|
||||
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.KeySpec;
|
||||
|
||||
/**
|
||||
KeyFactorySpi is the Service Provider Interface (SPI) for the
|
||||
KeyFactory class. This is the interface for providers to
|
||||
supply to implement a key factory for an algorithm.
|
||||
|
||||
Key factories are used to convert keys (opaque cryptographic
|
||||
keys of type Key) into key specifications (transparent
|
||||
representations of the underlying key material).
|
||||
|
||||
Key factories are bi-directional. They allow a key class
|
||||
to be converted into a key specification (key material) and
|
||||
back again.
|
||||
|
||||
For example DSA public keys can be specified as
|
||||
DSAPublicKeySpec or X509EncodedKeySpec. The key factory
|
||||
translate these key specifications.
|
||||
|
||||
@since JDK 1.2
|
||||
@author Mark Benvenuto
|
||||
* KeyFactorySpi is the Service Provider Interface (SPI) for the
|
||||
* KeyFactory class. This is the interface for providers to
|
||||
* supply to implement a key factory for an algorithm.
|
||||
*
|
||||
* Key factories are used to convert keys (opaque cryptographic
|
||||
* keys of type Key) into key specifications (transparent
|
||||
* representations of the underlying key material).
|
||||
*
|
||||
* Key factories are bi-directional. They allow a key class
|
||||
* to be converted into a key specification (key material) and
|
||||
* back again.
|
||||
*
|
||||
* For example DSA public keys can be specified as
|
||||
* DSAPublicKeySpec or X509EncodedKeySpec. The key factory
|
||||
* translate these key specifications.
|
||||
*
|
||||
* @since JDK 1.2
|
||||
* @author Mark Benvenuto
|
||||
*/
|
||||
public abstract class KeyFactorySpi
|
||||
{
|
||||
/**
|
||||
Constucts a new KeyFactorySpi.
|
||||
* Constucts a new KeyFactorySpi.
|
||||
*/
|
||||
public KeyFactorySpi()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Generates a public key from the provided key specification.
|
||||
|
||||
@param keySpec key specification
|
||||
|
||||
@return the public key
|
||||
|
||||
@throws InvalidKeySpecException invalid key specification for
|
||||
this key factory to produce a public key
|
||||
* Generates a public key from the provided key specification.
|
||||
*
|
||||
* @param keySpec key specification
|
||||
*
|
||||
* @return the public key
|
||||
*
|
||||
* @throws InvalidKeySpecException invalid key specification for
|
||||
* this key factory to produce a public key
|
||||
*/
|
||||
protected abstract PublicKey engineGeneratePublic(KeySpec keySpec)
|
||||
throws InvalidKeySpecException;
|
||||
|
||||
|
||||
/**
|
||||
Generates a private key from the provided key specification.
|
||||
|
||||
@param keySpec key specification
|
||||
|
||||
@return the private key
|
||||
|
||||
@throws InvalidKeySpecException invalid key specification for
|
||||
this key factory to produce a private key
|
||||
* Generates a private key from the provided key specification.
|
||||
*
|
||||
* @param keySpec key specification
|
||||
*
|
||||
* @return the private key
|
||||
*
|
||||
* @throws InvalidKeySpecException invalid key specification for
|
||||
* this key factory to produce a private key
|
||||
*/
|
||||
protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec)
|
||||
throws InvalidKeySpecException;
|
||||
|
||||
/**
|
||||
Returns a key specification for the given key. keySpec
|
||||
identifies the specification class to return the key
|
||||
material in.
|
||||
|
||||
@param key the key
|
||||
@param keySpec the specification class to return the
|
||||
key material in.
|
||||
|
||||
@return the key specification in an instance of the requested
|
||||
specification class
|
||||
|
||||
@throws InvalidKeySpecException the requested key specification
|
||||
is inappropriate for this key or the key is
|
||||
unrecognized.
|
||||
* Returns a key specification for the given key. keySpec
|
||||
* identifies the specification class to return the key
|
||||
* material in.
|
||||
*
|
||||
* @param key the key
|
||||
* @param keySpec the specification class to return the
|
||||
* key material in.
|
||||
*
|
||||
* @return the key specification in an instance of the requested
|
||||
* specification class
|
||||
*
|
||||
* @throws InvalidKeySpecException the requested key specification
|
||||
* is inappropriate for this key or the key is
|
||||
* unrecognized.
|
||||
*/
|
||||
protected abstract KeySpec engineGetKeySpec(Key key, Class keySpec)
|
||||
throws InvalidKeySpecException;
|
||||
|
||||
|
||||
/**
|
||||
Translates the key from an unknown or untrusted provider
|
||||
into a key for this key factory.
|
||||
|
||||
@param the key from an unknown or untrusted provider
|
||||
|
||||
@return the translated key
|
||||
|
||||
@throws InvalidKeySpecException if the key cannot be
|
||||
processed by this key factory
|
||||
* Translates the key from an unknown or untrusted provider
|
||||
* into a key for this key factory.
|
||||
*
|
||||
* @param the key from an unknown or untrusted provider
|
||||
*
|
||||
* @return the translated key
|
||||
*
|
||||
* @throws InvalidKeySpecException if the key cannot be
|
||||
* processed by this key factory
|
||||
*/
|
||||
protected abstract Key engineTranslateKey(Key key)
|
||||
throws InvalidKeyException;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* KeyPairGenerator.java --- Key Pair Generator Class
|
||||
Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,12 +35,13 @@ 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;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
/**
|
||||
* <p>The <code>KeyPairGenerator</code> class is used to generate pairs of
|
||||
* public and private keys. Key pair generators are constructed using the
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* KeyStore.java --- Key Store Class
|
||||
Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,17 +35,18 @@ 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;
|
||||
|
||||
import java.io.InputStream;
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* Keystore represents an in-memory collection of keys and
|
||||
* certificates. There are two types of entries:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* KeyStoreSpi.java --- Key Store Service Provider Interface
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,101 +35,103 @@ 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;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
KeyStoreSpi is the Service Provider Interface (SPI) for the
|
||||
KeyStore class. This is the interface for providers to
|
||||
supply to implement a keystore for a particular keystore
|
||||
type.
|
||||
|
||||
@since JDK 1.2
|
||||
@author Mark Benvenuto
|
||||
* KeyStoreSpi is the Service Provider Interface (SPI) for the
|
||||
* KeyStore class. This is the interface for providers to
|
||||
* supply to implement a keystore for a particular keystore
|
||||
* type.
|
||||
*
|
||||
* @since 1.2
|
||||
* @author Mark Benvenuto
|
||||
*/
|
||||
public abstract class KeyStoreSpi
|
||||
{
|
||||
/**
|
||||
Constructs a new KeyStoreSpi
|
||||
* Constructs a new KeyStoreSpi
|
||||
*/
|
||||
public KeyStoreSpi()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the key associated with given alias using the
|
||||
supplied password.
|
||||
|
||||
@param alias an alias for the key to get
|
||||
@param password password to access key with
|
||||
|
||||
@return the requested key, or null otherwise
|
||||
|
||||
@throws NoSuchAlgorithmException if there is no algorithm
|
||||
for recovering the key
|
||||
@throws UnrecoverableKeyException key cannot be reocovered
|
||||
(wrong password).
|
||||
* Returns the key associated with given alias using the
|
||||
* supplied password.
|
||||
*
|
||||
* @param alias an alias for the key to get
|
||||
* @param password password to access key with
|
||||
*
|
||||
* @return the requested key, or null otherwise
|
||||
*
|
||||
* @throws NoSuchAlgorithmException if there is no algorithm
|
||||
* for recovering the key
|
||||
* @throws UnrecoverableKeyException key cannot be reocovered
|
||||
* (wrong password).
|
||||
*/
|
||||
public abstract Key engineGetKey(String alias, char[]password)
|
||||
throws NoSuchAlgorithmException, UnrecoverableKeyException;
|
||||
|
||||
/**
|
||||
Gets a Certificate chain for the specified alias.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@return a chain of Certificates ( ordered from the user's
|
||||
certificate to the Certificate Authority's ) or
|
||||
null if the alias does not exist or there is no
|
||||
certificate chain for the alias ( the alias refers
|
||||
to a trusted certificate entry or there is no entry).
|
||||
* Gets a Certificate chain for the specified alias.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @return a chain of Certificates ( ordered from the user's
|
||||
* certificate to the Certificate Authority's ) or
|
||||
* null if the alias does not exist or there is no
|
||||
* certificate chain for the alias ( the alias refers
|
||||
* to a trusted certificate entry or there is no entry).
|
||||
*/
|
||||
public abstract java.security.cert.
|
||||
Certificate[] engineGetCertificateChain(String alias);
|
||||
|
||||
|
||||
/**
|
||||
Gets a Certificate for the specified alias.
|
||||
|
||||
If there is a trusted certificate entry then that is returned.
|
||||
it there is a key entry with a certificate chain then the
|
||||
first certificate is return or else null.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@return a Certificate or null if the alias does not exist
|
||||
or there is no certificate for the alias
|
||||
* Gets a Certificate for the specified alias.
|
||||
*
|
||||
* If there is a trusted certificate entry then that is returned.
|
||||
* it there is a key entry with a certificate chain then the
|
||||
* first certificate is return or else null.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @return a Certificate or null if the alias does not exist
|
||||
* or there is no certificate for the alias
|
||||
*/
|
||||
public abstract java.security.cert.
|
||||
Certificate engineGetCertificate(String alias);
|
||||
|
||||
/**
|
||||
Gets entry creation date for the specified alias.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@returns the entry creation date or null
|
||||
* Gets entry creation date for the specified alias.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @returns the entry creation date or null
|
||||
*/
|
||||
public abstract Date engineGetCreationDate(String alias);
|
||||
|
||||
/**
|
||||
Assign the key to the alias in the keystore, protecting it
|
||||
with the given password. It will overwrite an existing
|
||||
entry and if the key is a PrivateKey, also add the
|
||||
certificate chain representing the corresponding public key.
|
||||
|
||||
@param alias the alias name
|
||||
@param key the key to add
|
||||
@password the password to protect with
|
||||
@param chain the certificate chain for the corresponding
|
||||
public key
|
||||
|
||||
@throws KeyStoreException if it fails
|
||||
* Assign the key to the alias in the keystore, protecting it
|
||||
* with the given password. It will overwrite an existing
|
||||
* entry and if the key is a PrivateKey, also add the
|
||||
* certificate chain representing the corresponding public key.
|
||||
*
|
||||
* @param alias the alias name
|
||||
* @param key the key to add
|
||||
* @password the password to protect with
|
||||
* @param chain the certificate chain for the corresponding
|
||||
* public key
|
||||
*
|
||||
* @throws KeyStoreException if it fails
|
||||
*/
|
||||
public abstract void engineSetKeyEntry(String alias, Key key,
|
||||
char[]password,
|
||||
@ -138,17 +140,17 @@ public abstract class KeyStoreSpi
|
||||
KeyStoreException;
|
||||
|
||||
/**
|
||||
Assign the key to the alias in the keystore. It will overwrite
|
||||
an existing entry and if the key is a PrivateKey, also
|
||||
add the certificate chain representing the corresponding
|
||||
public key.
|
||||
|
||||
@param alias the alias name
|
||||
@param key the key to add
|
||||
@param chain the certificate chain for the corresponding
|
||||
public key
|
||||
|
||||
@throws KeyStoreException if it fails
|
||||
* Assign the key to the alias in the keystore. It will overwrite
|
||||
* an existing entry and if the key is a PrivateKey, also
|
||||
* add the certificate chain representing the corresponding
|
||||
* public key.
|
||||
*
|
||||
* @param alias the alias name
|
||||
* @param key the key to add
|
||||
* @param chain the certificate chain for the corresponding
|
||||
* public key
|
||||
*
|
||||
* @throws KeyStoreException if it fails
|
||||
*/
|
||||
public abstract void engineSetKeyEntry(String alias, byte[]key,
|
||||
java.security.cert.
|
||||
@ -157,13 +159,13 @@ public abstract class KeyStoreSpi
|
||||
|
||||
|
||||
/**
|
||||
Assign the certificate to the alias in the keystore. It
|
||||
will overwrite an existing entry.
|
||||
|
||||
@param alias the alias name
|
||||
@param cert the certificate to add
|
||||
|
||||
@throws KeyStoreException if it fails
|
||||
* Assign the certificate to the alias in the keystore. It
|
||||
* will overwrite an existing entry.
|
||||
*
|
||||
* @param alias the alias name
|
||||
* @param cert the certificate to add
|
||||
*
|
||||
* @throws KeyStoreException if it fails
|
||||
*/
|
||||
public abstract void engineSetCertificateEntry(String alias,
|
||||
java.security.cert.
|
||||
@ -171,102 +173,102 @@ public abstract class KeyStoreSpi
|
||||
KeyStoreException;
|
||||
|
||||
/**
|
||||
Deletes the entry for the specified entry.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@throws KeyStoreException if it fails
|
||||
* Deletes the entry for the specified entry.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @throws KeyStoreException if it fails
|
||||
*/
|
||||
public abstract void engineDeleteEntry(String alias)
|
||||
throws KeyStoreException;
|
||||
|
||||
/**
|
||||
Generates a list of all the aliases in the keystore.
|
||||
|
||||
@return an Enumeration of the aliases
|
||||
* Generates a list of all the aliases in the keystore.
|
||||
*
|
||||
* @return an Enumeration of the aliases
|
||||
*/
|
||||
public abstract Enumeration engineAliases();
|
||||
|
||||
/**
|
||||
Determines if the keystore contains the specified alias.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@return true if it contains the alias, false otherwise
|
||||
* Determines if the keystore contains the specified alias.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @return true if it contains the alias, false otherwise
|
||||
*/
|
||||
public abstract boolean engineContainsAlias(String alias);
|
||||
|
||||
/**
|
||||
Returns the number of entries in the keystore.
|
||||
|
||||
@returns the number of keystore entries.
|
||||
* Returns the number of entries in the keystore.
|
||||
*
|
||||
* @returns the number of keystore entries.
|
||||
*/
|
||||
public abstract int engineSize();
|
||||
|
||||
/**
|
||||
Determines if the keystore contains a key entry for
|
||||
the specified alias.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@return true if it is a key entry, false otherwise
|
||||
* Determines if the keystore contains a key entry for
|
||||
* the specified alias.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @return true if it is a key entry, false otherwise
|
||||
*/
|
||||
public abstract boolean engineIsKeyEntry(String alias);
|
||||
|
||||
/**
|
||||
Determines if the keystore contains a certificate entry for
|
||||
the specified alias.
|
||||
|
||||
@param alias the alias name
|
||||
|
||||
@return true if it is a certificate entry, false otherwise
|
||||
* Determines if the keystore contains a certificate entry for
|
||||
* the specified alias.
|
||||
*
|
||||
* @param alias the alias name
|
||||
*
|
||||
* @return true if it is a certificate entry, false otherwise
|
||||
*/
|
||||
public abstract boolean engineIsCertificateEntry(String alias);
|
||||
|
||||
/**
|
||||
Determines if the keystore contains the specified certificate
|
||||
entry and returns the alias.
|
||||
|
||||
It checks every entry and for a key entry checks only the
|
||||
first certificate in the chain.
|
||||
|
||||
@param cert Certificate to look for
|
||||
|
||||
@return alias of first matching certificate, null if it
|
||||
does not exist.
|
||||
* Determines if the keystore contains the specified certificate
|
||||
* entry and returns the alias.
|
||||
*
|
||||
* It checks every entry and for a key entry checks only the
|
||||
* first certificate in the chain.
|
||||
*
|
||||
* @param cert Certificate to look for
|
||||
*
|
||||
* @return alias of first matching certificate, null if it
|
||||
* does not exist.
|
||||
*/
|
||||
public abstract String engineGetCertificateAlias(java.security.cert.
|
||||
Certificate cert);
|
||||
|
||||
/**
|
||||
Stores the keystore in the specified output stream and it
|
||||
uses the specified key it keep it secure.
|
||||
|
||||
@param stream the output stream to save the keystore to
|
||||
@param password the password to protect the keystore integrity with
|
||||
|
||||
@throws IOException if an I/O error occurs.
|
||||
@throws NoSuchAlgorithmException the data integrity algorithm
|
||||
used cannot be found.
|
||||
@throws CertificateException if any certificates could not be
|
||||
stored in the output stream.
|
||||
* Stores the keystore in the specified output stream and it
|
||||
* uses the specified key it keep it secure.
|
||||
*
|
||||
* @param stream the output stream to save the keystore to
|
||||
* @param password the password to protect the keystore integrity with
|
||||
*
|
||||
* @throws IOException if an I/O error occurs.
|
||||
* @throws NoSuchAlgorithmException the data integrity algorithm
|
||||
* used cannot be found.
|
||||
* @throws CertificateException if any certificates could not be
|
||||
* stored in the output stream.
|
||||
*/
|
||||
public abstract void engineStore(OutputStream stream, char[]password)
|
||||
throws IOException, NoSuchAlgorithmException, CertificateException;
|
||||
|
||||
|
||||
/**
|
||||
Loads the keystore from the specified input stream and it
|
||||
uses the specified password to check for integrity if supplied.
|
||||
|
||||
@param stream the input stream to load the keystore from
|
||||
@param password the password to check the keystore integrity with
|
||||
|
||||
@throws IOException if an I/O error occurs.
|
||||
@throws NoSuchAlgorithmException the data integrity algorithm
|
||||
used cannot be found.
|
||||
@throws CertificateException if any certificates could not be
|
||||
stored in the output stream.
|
||||
* Loads the keystore from the specified input stream and it
|
||||
* uses the specified password to check for integrity if supplied.
|
||||
*
|
||||
* @param stream the input stream to load the keystore from
|
||||
* @param password the password to check the keystore integrity with
|
||||
*
|
||||
* @throws IOException if an I/O error occurs.
|
||||
* @throws NoSuchAlgorithmException the data integrity algorithm
|
||||
* used cannot be found.
|
||||
* @throws CertificateException if any certificates could not be
|
||||
* stored in the output stream.
|
||||
*/
|
||||
public abstract void engineLoad(InputStream stream, char[]password)
|
||||
throws IOException, NoSuchAlgorithmException, CertificateException;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Permissions.java -- a collection of permission collections
|
||||
Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,11 +35,12 @@ 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;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
|
@ -35,13 +35,14 @@ 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;
|
||||
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.security.AccessController;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
|
@ -35,14 +35,15 @@ 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;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.cert.Certificate;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* <p>This <code>Signature</code> class is used to provide applications the
|
||||
* functionality of a digital signature algorithm. Digital signatures are used
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* UnresolvedPermission.java -- Placeholder for unresolved permissions
|
||||
Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -35,16 +35,17 @@ 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;
|
||||
|
||||
// All uses of Certificate in this file refer to the one in the listed
|
||||
// package, not this one.
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.Arrays;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Vector;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Hashtable;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* This class is used to hold instances of all permissions that cannot
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* CertPathBuilder.java -- bulids CertPath objects from Certificates.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,14 +38,14 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* This class builds certificate paths (also called certificate chains),
|
||||
* which can be used to establish trust for a particular certificate by
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* CertPathValidator -- validates certificate paths.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,6 +38,8 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@ -46,8 +48,6 @@ import java.security.PrivilegedAction;
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* Generic interface to classes that validate certificate paths.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* CertStore -- stores and retrieves certificates.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,17 +38,16 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* A CertStore is a read-only repository for certificates and
|
||||
* certificate revocation lists.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Certificate.java --- Certificate class
|
||||
Copyright (C) 1999,2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,15 +38,15 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import java.security.PublicKey;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.SignatureException;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.InvalidObjectException;
|
||||
import java.io.ObjectStreamException;
|
||||
import java.io.Serializable;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.PublicKey;
|
||||
import java.security.SignatureException;
|
||||
|
||||
/**
|
||||
* The Certificate class is an abstract class used to manage
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* CertificateFactory.java -- Certificate Factory Class
|
||||
Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,19 +38,17 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.Provider;
|
||||
import java.security.Security;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import gnu.java.security.Engine;
|
||||
|
||||
/**
|
||||
* This class implements the CertificateFactory class interface used to
|
||||
* generate certificates, certificate revocation lists (CRLs), and certificate
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* PolicyQualifierInfo.java -- policy qualifier info object.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,14 +38,14 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import gnu.java.io.ASN1ParsingException;
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.der.DERReader;
|
||||
import gnu.java.security.der.DERValue;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* The PolicyQualifierInfo X.509 certificate extension.
|
||||
* PolicyQualifierInfo objects are represented by the ASN.1 structure:
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* TrustAnchor.java -- an ultimately-trusted certificate.
|
||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -38,10 +38,10 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
import gnu.java.security.x509.X500DistinguishedName;
|
||||
|
||||
import java.security.PublicKey;
|
||||
|
||||
/**
|
||||
* An ultimately-trusted certificate to serve as the root of a
|
||||
* certificate chain.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* X509CRL.java --- X.509 Certificate Revocation List
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
@ -39,11 +39,11 @@ exception statement from your version. */
|
||||
package java.security.cert;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.Principal;
|
||||
import java.security.PublicKey;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchProviderException;
|
||||
import java.security.SignatureException;
|
||||
import java.util.Date;
|
||||
import java.util.Set;
|
||||
|
@ -38,13 +38,14 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
import gnu.java.security.der.DERReader;
|
||||
import gnu.java.security.der.DERValue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.security.AccessController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -55,10 +56,6 @@ import java.util.List;
|
||||
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
import gnu.java.security.der.DERReader;
|
||||
import gnu.java.security.der.DERValue;
|
||||
|
||||
/**
|
||||
* A class for matching X.509 certificate revocation lists by criteria.
|
||||
*
|
||||
|
@ -38,15 +38,15 @@ exception statement from your version. */
|
||||
|
||||
package java.security.cert;
|
||||
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
@ -60,9 +60,6 @@ import java.util.Set;
|
||||
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
|
||||
import gnu.java.security.OID;
|
||||
import gnu.java.security.action.GetPropertyAction;
|
||||
|
||||
/**
|
||||
* A concrete implementation of {@link CertSelector} for X.509 certificates,
|
||||
* which allows a number of criteria to be set when accepting certificates,
|
||||
|
Loading…
Reference in New Issue
Block a user