Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.security

Class AlgorithmParameters

java.lang.Object
|
+--java.security.AlgorithmParameters


public class AlgorithmParameters

extends Object

AlgorithmParameters 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:

Constructor Summary

AlgorithmParameters(java.security.AlgorithmParametersSpi paramSpi, java.security.Provider provider, java.lang.String algorithm)

Creates an instance of AlgorithmParameters

Method Summary

java.lang.StringgetAlgorithm()

Returns the name of the algorithm used
byte[]getEncoded()

Returns the parameters in the default encoding format.
byte[]getEncoded(java.lang.String format)

Returns the parameters in the specified encoding format.
static java.security.AlgorithmParametersgetInstance(java.lang.String algorithm)

Gets an instance of the AlgorithmParameters class representing the specified algorithm parameters.
static java.security.AlgorithmParametersgetInstance(java.lang.String algorithm, java.lang.String provider)

Gets an instance of the AlgorithmParameters class representing the specified algorithm parameters from the specified provider.
java.security.spec.AlgorithmParameterSpecgetParameterSpec(java.lang.Class paramSpec)

Returns a specification of this AlgorithmParameters object.
java.security.ProvidergetProvider()

Gets the provider that the class is from.
voidinit(java.security.spec.AlgorithmParameterSpec paramSpec)

Initializes the engine with the specified AlgorithmParameterSpec class.
voidinit(byte[] )

Initializes the engine with the specified parameters stored in the byte array and decodes them according to the ASN.1 specification.
voidinit(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.
java.lang.StringtoString()

Returns a string representation of the encoding format

Constructor Details

AlgorithmParameters

protected AlgorithmParameters(java.security.AlgorithmParametersSpi paramSpi, java.security.Provider provider, java.lang.String algorithm)

Creates an instance of AlgorithmParameters

Parameters:


Method Details

getAlgorithm

public final String getAlgorithm()

Returns the name of the algorithm used

Returns:


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:


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:


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:

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:

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:

Throws:


getProvider

public final Provider getProvider()

Gets the provider that the class is from.

Returns:


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: