java.lang.Object
java.security.KeyPairGeneratorSpi
com.ibm.crypto.hdwrCCA.provider.DSAKeyPairGenerator
This class generates DSA public/private key pairs via hardware. An application
can specify the size, the key label, the storage type, the key usage and the
DSA parameters of the key pair to be generated via an instance of
DSAHWKeyParametersSpec class. The default key is of size 512 with a
random-generated label. Please note: that the storage type can only be
encrypted outside the hardware device (KeyHWAttributeValues.PKDS) and the usage
can only be signature only (KeyHWAttributeValues.Signature).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates an DSA key pair via hardware.void
initialize
(int keySize, SecureRandom random) Initialize Key Pair Generator using the given secure random generator, and generate keys of a certain size.void
initialize
(AlgorithmParameterSpec params, SecureRandom random) Initialize Key Pair Generator using the given secure random generator, and generate keys from the provided set of parameters.
-
Constructor Details
-
DSAKeyPairGenerator
public DSAKeyPairGenerator()Constructs a new instance of this class.
-
-
Method Details
-
initialize
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException, InvalidParameterException Initialize Key Pair Generator using the given secure random generator, and generate keys from the provided set of parameters.- Overrides:
initialize
in classKeyPairGeneratorSpi
- Parameters:
params
- the parameter set to be used to generate the keys.random
- the source of randomness for this generator.- Throws:
InvalidAlgorithmParameterException
- is thrown if the params parameter is not an instance of DSAParameterSpec or DSAHWKeyParameterSpec.InvalidParameterException
- is thrown when key size of a DSAHWKeyParameterSpec parameter set is invalid.
-
initialize
Initialize Key Pair Generator using the given secure random generator, and generate keys of a certain size.- Specified by:
initialize
in classKeyPairGeneratorSpi
- Parameters:
keySize
- new size of keys, in bits.random
- the source of randomness for this generator.- Throws:
InvalidParameterException
- is thrown when keySize is invalid.
-
generateKeyPair
Generates an DSA key pair via hardware. The public key is usable outside this provider. However, the private key is stored in a hardware associated file(PKDS) and is therefore only useable by this provider on the machine that generated the key pair.- Specified by:
generateKeyPair
in classKeyPairGeneratorSpi
- Returns:
- a newly generated DSA key pair.
- Throws:
InternalError
- is thrown when an unexpected error occurs.
-