public class IvParameterGenerator
extends java.security.AlgorithmParameterGeneratorSpi
Applications shall use "IV" or the desired algorithm name for obtaining an AlgorithmParameterGenerator for generating IV parameters in opaque representation:
AlgorithmParameterGenerator.getInstance("IV")Once the generator has been created, it may be properly initialized by one of the several
init
methods.
If none explicit initialization is done, per default the iv length is set to 8 bytes.
After initializing the generator (or relying on default settings), the required parameters
actually are created by calling the generateParameters
method.Constructor and Description |
---|
IvParameterGenerator()
The default constructor.
|
IvParameterGenerator(int ivLength)
Creates a IvParameterGenerator for the given iv length.
|
Modifier and Type | Method and Description |
---|---|
protected java.security.AlgorithmParameters |
engineGenerateParameters()
Actually generates the required IV AlgorithmParameters.
|
protected void |
engineInit(java.security.spec.AlgorithmParameterSpec param,
java.security.SecureRandom random)
Initializes this generator with iv-specific parameter generation values and
some random seed.
|
protected void |
engineInit(int ivLength,
java.security.SecureRandom random)
Initializes the parameter generator with given iv length.
|
public IvParameterGenerator()
Only internally used for creating a IvParameterGenerator object. Applications
shall use one of the AlgorithmParameterGenerator.getInstance
factory
methods for obtaining an AlgorithmParamterGenerator for generating iv parameters.
public IvParameterGenerator(int ivLength)
Only internally used for creating a IvParameterGenerator object. Applications
shall use one of the AlgorithmParameterGenerator.getInstance
factory
methods for obtaining an AlgorithmParamterGenerator for generating iv parameters.
ivLength
- the length of the initialization vector (in bytes)protected void engineInit(int ivLength, java.security.SecureRandom random)
engineInit
in class java.security.AlgorithmParameterGeneratorSpi
ivLength
- the length of the initialization vectorrandom
- the random seed to be used by this generator.protected void engineInit(java.security.spec.AlgorithmParameterSpec param, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
From the given parameter specification (which has to be of type
IvGenParameterSpec
) the iv length is obtained for
generating the algorithm parameters.
Applications shall call init(param_spec, random)
for provider
independently accessing this method.
engineInit
in class java.security.AlgorithmParameterGeneratorSpi
param
- an instance of IvGenParameterSpecrandom
- the random seed to be used by this generator.java.security.InvalidAlgorithmParameterException
- if param
is not an
instance of IvGenParameterSpecprotected java.security.AlgorithmParameters engineGenerateParameters()
Applications shall call generatePrameters()
for provider
independently accessing this method.
engineGenerateParameters
in class java.security.AlgorithmParameterGeneratorSpi