Skip to content

Most visited

Recently visited

navigation
Added in API level 1

AlgorithmParameters

public class AlgorithmParameters
extends Object

java.lang.Object
   ↳ java.security.AlgorithmParameters


AlgorithmParameters is an engine class which provides algorithm parameters.

Summary

Protected constructors

AlgorithmParameters(AlgorithmParametersSpi algPramSpi, Provider provider, String algorithm)

Constructs a new instance of AlgorithmParameters with the given arguments.

Public methods

final String getAlgorithm()

Returns the name of the algorithm.

final byte[] getEncoded(String format)

Returns this AlgorithmParameters in the specified encoding format.

final byte[] getEncoded()

Returns this AlgorithmParameters in their default encoding format.

static AlgorithmParameters getInstance(String algorithm, String provider)

Returns a new instance of AlgorithmParameters from the specified provider 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)

Returns a new instance of AlgorithmParameters for the specified algorithm.

final <T extends AlgorithmParameterSpec> T getParameterSpec(Class<T> paramSpec)

Returns the AlgorithmParameterSpec for this AlgorithmParameters.

final Provider getProvider()

Returns the provider associated with this AlgorithmParameters.

final void init(AlgorithmParameterSpec paramSpec)

Initializes this AlgorithmParameters with the specified AlgorithmParameterSpec.

final void init(byte[] params, String format)

Initializes this AlgorithmParameters with the specified byte[] using the specified decoding format.

final void init(byte[] params)

Initializes this AlgorithmParameters with the specified byte[] using the default decoding format for parameters.

final String toString()

Returns a string containing a concise, human-readable description of this AlgorithmParameters.

Inherited methods

From class java.lang.Object

Protected constructors

AlgorithmParameters

Added in API level 1
AlgorithmParameters (AlgorithmParametersSpi algPramSpi, 
                Provider provider, 
                String algorithm)

Constructs a new instance of AlgorithmParameters with the given arguments.

Parameters
algPramSpi AlgorithmParametersSpi: the concrete implementation.
provider Provider: the security provider.
algorithm String: the name of the algorithm.

Public methods

getAlgorithm

Added in API level 1
String getAlgorithm ()

Returns the name of the algorithm.

Returns
String the name of the algorithm.

getEncoded

Added in API level 1
byte[] getEncoded (String format)

Returns this AlgorithmParameters in the specified encoding format.

Parameters
format String: the name of the encoding format.
Returns
byte[] the encoded parameters.
Throws
IOException if this AlgorithmParameters has already been initialized, or if this parameters could not be encoded.

getEncoded

Added in API level 1
byte[] getEncoded ()

Returns this AlgorithmParameters in their default encoding format. The default encoding format is ASN.1.

Returns
byte[] the encoded parameters.
Throws
IOException if this AlgorithmParameters has already been initialized, or if this parameters could not be encoded.

getInstance

Added in API level 1
AlgorithmParameters getInstance (String algorithm, 
                String provider)

Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm.

Parameters
algorithm String: the name of the algorithm to use.
provider String: name of the provider of the AlgorithmParameters.
Returns
AlgorithmParameters 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 == null || provider.isEmpty()
NullPointerException if algorithm is null.

getInstance

Added in API level 1
AlgorithmParameters getInstance (String algorithm, 
                Provider provider)

Returns a new instance of AlgorithmParameters from the specified provider for the specified algorithm. The provider supplied does not have to be registered.

Parameters
algorithm String: the name of the algorithm to use.
provider Provider: the provider of the AlgorithmParameters.
Returns
AlgorithmParameters 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 == null

getInstance

Added in API level 1
AlgorithmParameters getInstance (String algorithm)

Returns a new instance of AlgorithmParameters for the specified algorithm.

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

getParameterSpec

Added in API level 1
T getParameterSpec (Class<T> paramSpec)

Returns the AlgorithmParameterSpec for this AlgorithmParameters.

Parameters
paramSpec Class: the type of the parameter specification in which this parameters should be converted.
Returns
T 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.

getProvider

Added in API level 1
Provider getProvider ()

Returns the provider associated with this AlgorithmParameters.

Returns
Provider the provider associated with this AlgorithmParameters.

init

Added in API level 1
void init (AlgorithmParameterSpec paramSpec)

Initializes this AlgorithmParameters with the specified AlgorithmParameterSpec.

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

init

Added in API level 1
void init (byte[] params, 
                String format)

Initializes this AlgorithmParameters with the specified byte[] using the specified decoding format.

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

init

Added in API level 1
void init (byte[] params)

Initializes this AlgorithmParameters with the specified byte[] using the default decoding format for parameters. The default encoding format is ASN.1.

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

toString

Added in API level 1
String toString ()

Returns a string containing a concise, human-readable description of this AlgorithmParameters.

Returns
String a printable representation for this AlgorithmParameters.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.