java.security
Class AlgorithmParameters
java.lang.Object
|
+--java.security.AlgorithmParameters
public class
AlgorithmParametersextends
ObjectAlgorithmParameters is the Algorithm Parameters class which
provides an interface through which to modify parameters for
classes. This class is used to manage the algorithm parameters.
Since:Author:AlgorithmParameters
protected AlgorithmParameters(java.security.AlgorithmParametersSpi paramSpi, java.security.Provider provider, java.lang.String algorithm)
Creates an instance of AlgorithmParameters
Parameters:
getAlgorithm
public final String getAlgorithm()
Returns the name of the algorithm used
Returns:
- A string with the name of the algorithm
getEncoded
public final byte[] getEncoded()
Returns the parameters in the default encoding format.
The primary encoding format is ASN.1 format if it exists
for the specified type.
Returns:
- byte array representing the parameters
getEncoded
public final byte[] getEncoded(java.lang.String format)
Returns the parameters in the specified encoding format.
If format
is null
then the
primary encoding format is used, the ASN.1 format,
if it exists for the specified type.
Parameters:
Returns:
- byte array representing the parameters
getInstance
public static AlgorithmParameters getInstance(java.lang.String algorithm)
Gets an instance of the AlgorithmParameters class representing
the specified algorithm parameters. If the algorithm is not
found then, it throws NoSuchAlgorithmException.
The returned AlgorithmParameters must still be intialized with
init().
Parameters:
Returns:
- a AlgorithmParameters repesenting the desired algorithm
Throws:
getInstance
public static AlgorithmParameters getInstance(java.lang.String algorithm, java.lang.String provider)
Gets an instance of the AlgorithmParameters class representing
the specified algorithm parameters from the specified provider.
If the algorithm is not found then, it throws
NoSuchAlgorithmException. If the provider is not found, then
it throws NoSuchProviderException.
The returned AlgorithmParameters must still be intialized with
init().
Parameters:
Returns:
- a AlgorithmParameters repesenting the desired algorithm
Throws:
getParameterSpec
public final AlgorithmParameterSpec getParameterSpec(java.lang.Class paramSpec)
Returns a specification of this AlgorithmParameters object.
paramSpec identifies the class to return the AlgortihmParameters
in.
Parameters:
Returns:
- the parameter specification
Throws:
getProvider
public final Provider getProvider()
Gets the provider that the class is from.
Returns:
- the provider of this class
init
public final void init(byte[] )
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.
Parameters:
Throws:
init
public final void init(byte[] , java.lang.String format)
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.
Parameters:
Throws:
init
public final void init(java.security.spec.AlgorithmParameterSpec paramSpec)
Initializes the engine with the specified
AlgorithmParameterSpec class.
Parameters:
Throws:
toString
public final String toString()
Returns a string representation of the encoding format
Returns:
- a string containing the string representation