Build 1.1_r1 (from source)

java.security
Class AlgorithmParameters

java.lang.Object
  extended by java.security.AlgorithmParameters

public class AlgorithmParameters
extends Object

AlgorithmParameters is an engine class which provides algorithm parameters.

Since:
Android 1.0

Constructor Summary
protected AlgorithmParameters(AlgorithmParametersSpi algPramSpi, Provider provider, String algorithm)
          Constructs a new instance of AlgorithmParameters with the given arguments.
 
Method Summary
 String getAlgorithm()
          Returns the name of the algorithm.
 byte[] getEncoded()
          Returns this AlgorithmParameters in their default encoding format.
 byte[] getEncoded(String format)
          Returns this AlgorithmParameters in the specified encoding format.
static AlgorithmParameters getInstance(String algorithm)
          Returns a new instance of AlgorithmParameters for the specified algorithm.
static AlgorithmParameters getInstance(String algorithm, Provider provider)
          Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm.
static AlgorithmParameters getInstance(String algorithm, String provider)
          Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm.
<T extends AlgorithmParameterSpec>
T
getParameterSpec(Class<T> paramSpec)
          Returns the AlgorithmParameterSpec for this AlgorithmParameters.
 Provider getProvider()
          Returns the provider associated with this AlgorithmParameters.
 void init(AlgorithmParameterSpec paramSpec)
          Initializes this AlgorithmParameters with the specified AlgorithmParameterSpec.
 void init(byte[] params)
          Initializes this AlgorithmParameters with the specified byte[] using the default decoding format for parameters.
 void init(byte[] params, String format)
          Initializes this AlgorithmParameters with the specified byte[] using the specified decoding format.
 String toString()
          Returns a string containing a concise, human-readable description of this AlgorithmParameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlgorithmParameters

protected AlgorithmParameters(AlgorithmParametersSpi algPramSpi,
                              Provider provider,
                              String algorithm)
Constructs a new instance of AlgorithmParameters with the given arguments.

Parameters:
algPramSpi - the concrete implementation.
provider - the security provider.
algorithm - the name of the algorithm.
Since:
Android 1.0
Method Detail

getInstance

public static AlgorithmParameters getInstance(String algorithm)
                                       throws NoSuchAlgorithmException
Returns a new instance of AlgorithmParameters for the specified algorithm.

Parameters:
algorithm - the name of the algorithm to use.
Returns:
a new instance of AlgorithmParameters for the specified algorithm.
Throws:
NoSuchAlgorithmException - if the specified algorithm is not available.
NullPointerException - if algorithm is null.
Since:
Android 1.0

getInstance

public static AlgorithmParameters getInstance(String algorithm,
                                              String provider)
                                       throws NoSuchAlgorithmException,
                                              NoSuchProviderException
Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm.

Parameters:
algorithm - the name of the algorithm to use.
provider - name of the provider of the AlgorithmParameters.
Returns:
a new instance of AlgorithmParameters for the specified algorithm.
Throws:
NoSuchAlgorithmException - if the specified algorithm is not available.
NoSuchProviderException - if the specified provider is not available.
IllegalArgumentException - if provider is null or of length zero.
NullPointerException - if algorithm is null.
Since:
Android 1.0

getInstance

public static AlgorithmParameters getInstance(String algorithm,
                                              Provider provider)
                                       throws NoSuchAlgorithmException
Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm.

Parameters:
algorithm - the name of the algorithm to use.
provider - the provider of the AlgorithmParameters.
Returns:
a new instance of AlgorithmParameters for the specified algorithm.
Throws:
NoSuchAlgorithmException - if the specified algorithm is not available.
NullPointerException - if algorithm is null.
IllegalArgumentException - if provider is null.
Since:
Android 1.0

getProvider

public final Provider getProvider()
Returns the provider associated with this AlgorithmParameters.

Returns:
the provider associated with this AlgorithmParameters.
Since:
Android 1.0

getAlgorithm

public final String getAlgorithm()
Returns the name of the algorithm.

Returns:
the name of the algorithm.
Since:
Android 1.0

init

public final void init(AlgorithmParameterSpec paramSpec)
                throws InvalidParameterSpecException
Initializes this AlgorithmParameters with the specified AlgorithmParameterSpec.

Parameters:
paramSpec - the parameter specification.
Throws:
InvalidParameterSpecException - if this AlgorithmParameters has already been initialized or the given paramSpec is not appropriate for initializing this AlgorithmParameters.
Since:
Android 1.0

init

public final void init(byte[] params)
                throws IOException
Initializes this AlgorithmParameters with the specified byte[] using the default decoding format for parameters. The default encoding format is ASN.1.

Parameters:
params - the encoded parameters.
Throws:
IOException - if this AlgorithmParameters has already been initialized, or the parameter could not be encoded.
Since:
Android 1.0

init

public final void init(byte[] params,
                       String format)
                throws IOException
Initializes this AlgorithmParameters with the specified byte[] using the specified decoding format.

Parameters:
params - the encoded parameters.
format - the name of the decoding format.
Throws:
IOException - if this AlgorithmParameters has already been initialized, or the parameter could not be encoded.
Since:
Android 1.0

getParameterSpec

public final <T extends AlgorithmParameterSpec> T getParameterSpec(Class<T> paramSpec)
                                                        throws InvalidParameterSpecException
Returns the AlgorithmParameterSpec for this AlgorithmParameters.

Parameters:
paramSpec - the type of the parameter specification in which this parameters should be converted.
Returns:
the AlgorithmParameterSpec for this AlgorithmParameters.
Throws:
InvalidParameterSpecException - if this AlgorithmParameters has already been initialized, or if this parameters could not be converted to the specified class.
Since:
Android 1.0

getEncoded

public final byte[] getEncoded()
                        throws IOException
Returns this AlgorithmParameters in their default encoding format. The default encoding format is ASN.1.

Returns:
the encoded parameters.
Throws:
IOException - if this AlgorithmParameters has already been initialized, or if this parameters could not be encoded.
Since:
Android 1.0

getEncoded

public final byte[] getEncoded(String format)
                        throws IOException
Returns this AlgorithmParameters in the specified encoding format.

Parameters:
format - the name of the encoding format.
Returns:
the encoded parameters.
Throws:
IOException - if this AlgorithmParameters has already been initialized, or if this parameters could not be encoded.
Since:
Android 1.0

toString

public final String toString()
Returns a string containing a concise, human-readable description of this AlgorithmParameters.

Overrides:
toString in class Object
Returns:
a printable representation for this AlgorithmParameters.
Since:
Android 1.0

Build 1.1_r1 (from source)

Please submit a feedback, bug or feature