Top Description Constructors Methods
java.security

public abstract Class AlgorithmParametersSpi

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.crypto.provider.AESParameters, com.sun.crypto.provider.BlowfishParameters, com.sun.crypto.provider.DESedeParameters, com.sun.crypto.provider.DESParameters, com.sun.crypto.provider.DHParameters, com.sun.crypto.provider.OAEPParameters, com.sun.crypto.provider.ChaCha20Poly1305Parameters, com.sun.crypto.provider.GCMParameters, com.sun.crypto.provider.PBEParameters, com.sun.crypto.provider.PBES2Parameters, com.sun.crypto.provider.RC2Parameters, sun.security.provider.DSAParameters, sun.security.rsa.PSSParameters, sun.security.util.ECParameters, sun.security.util.GCMParameters, sun.security.ec.ed.EdDSAAlgorithmParameters
Imports
java.io.*, java.security.spec.AlgorithmParameterSpec, .InvalidParameterSpecException

This class defines the Service Provider Interface (SPI) for the AlgorithmParameters class, which is used to manage algorithm parameters.

All the abstract methods in this class must be implemented by each cryptographic service provider who wishes to supply parameter management for a particular algorithm.

Author
Jan Luehe
Since
1.2
See Also
AlgorithmParameters, java.security.spec.AlgorithmParameterSpec, java.security.spec.DSAParameterSpec

Constructor Summary

AccessConstructor and Description
public
AlgorithmParametersSpi()

Constructor for subclasses to call.

Method Summary

Modifier and TypeMethod and Description
protected abstract byte[]

Returns:

the parameters encoded using their primary encoding format.
engineGetEncoded
()

Returns the parameters in their primary encoding format.

protected abstract byte[]

Returns:

the parameters encoded using the specified encoding scheme.
engineGetEncoded
(String
the name of the encoding format.
format
)

Returns the parameters encoded in the specified format.

protected abstract <
the type of the parameter specification to be returned
T extends AlgorithmParameterSpec
>
T

Returns:

the parameter specification.
engineGetParameterSpec
(Class<T>
the specification class in which the parameters should be returned.
paramSpec
)

Returns a (transparent) specification of this parameters object.

protected abstract void
engineInit(AlgorithmParameterSpec
the parameter specification.
paramSpec
)

Initializes this parameters object using the parameters specified in paramSpec.

protected abstract void
engineInit(byte[]
the encoded parameters.
params
)

Imports the specified parameters and decodes them according to the primary decoding format for parameters.

protected abstract void
engineInit(byte[]
the encoded parameters.
params
,
String
the name of the decoding format.
format
)

Imports the parameters from params and decodes them according to the specified decoding format.

protected abstract String

Returns:

a formatted string describing the parameters.
engineToString
()

Returns a formatted string describing the parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AlgorithmParametersSpiback to summary
public AlgorithmParametersSpi()

Constructor for subclasses to call.

Method Detail

engineGetEncodedback to summary
protected abstract byte[] engineGetEncoded() throws IOException

Returns the parameters in their primary encoding format. The primary encoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Returns:byte[]

the parameters encoded using their primary encoding format.

Exceptions
IOException:
on encoding errors.
engineGetEncodedback to summary
protected abstract byte[] engineGetEncoded(String format) throws IOException

Returns the parameters encoded in the specified format. If format is null, the primary encoding format for parameters is used. The primary encoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Parameters
format:String

the name of the encoding format.

Returns:byte[]

the parameters encoded using the specified encoding scheme.

Exceptions
IOException:
on encoding errors.
engineGetParameterSpecback to summary
protected abstract <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> paramSpec) throws InvalidParameterSpecException

Returns a (transparent) specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned. It could, for example, be DSAParameterSpec.class, to indicate that the parameters should be returned in an instance of the DSAParameterSpec class.

Parameters
<T>
the type of the parameter specification to be returned
paramSpec:Class<T>

the specification class in which the parameters should be returned.

Returns:T

the parameter specification.

Exceptions
InvalidParameterSpecException:
if the requested parameter specification is inappropriate for this parameter object.
engineInitback to summary
protected abstract void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException

Initializes this parameters object using the parameters specified in paramSpec.

Parameters
paramSpec:AlgorithmParameterSpec

the parameter specification.

Exceptions
InvalidParameterSpecException:
if the given parameter specification is inappropriate for the initialization of this parameter object.
engineInitback to summary
protected abstract void engineInit(byte[] params) throws IOException

Imports the specified parameters and decodes them according to the primary decoding format for parameters. The primary decoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Parameters
params:byte[]

the encoded parameters.

Exceptions
IOException:
on decoding errors
engineInitback to summary
protected abstract void engineInit(byte[] params, String format) throws IOException

Imports the parameters from params and decodes them according to the specified decoding format. If format is null, the primary decoding format for parameters is used. The primary decoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Parameters
params:byte[]

the encoded parameters.

format:String

the name of the decoding format.

Exceptions
IOException:
on decoding errors
engineToStringback to summary
protected abstract String engineToString()

Returns a formatted string describing the parameters.

Returns:String

a formatted string describing the parameters.