com.ibm.crypto.hdwrCCA.provider
Class ECKeyPairGenerator
- java.lang.Object
-
- java.security.KeyPairGeneratorSpi
-
- com.ibm.crypto.hdwrCCA.provider.ECKeyPairGenerator
-
public final class ECKeyPairGenerator extends java.security.KeyPairGeneratorSpi
This class generates EC public and private key pairs. An application can specify the key size, key label, storage type and usage type of the key pair to be generated via an instance of theAlgorithmParameterSpec
class. The default key has a size of 256, stored in the CLEAR, and with key management functionalities if key management is supported by Elliptic Curve keys. If key management is not supported, then the default usage will be signature.
-
-
Constructor Summary
Constructors Constructor and Description ECKeyPairGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.security.KeyPair
generateKeyPair()
Generates an Elliptic Curve key pair.void
initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
Initializes the key pair generator using the specified parameter set and user-provided source of randomness.void
initialize(int keysize, java.security.SecureRandom random)
Initializes the key pair generator for a certain key size, using the default parameter set.
-
-
-
Method Detail
-
initialize
public void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws java.security.InvalidAlgorithmParameterException
Initializes the key pair generator using the specified parameter set and user-provided source of randomness.- Overrides:
initialize
in classjava.security.KeyPairGeneratorSpi
- Parameters:
params
- the parameter set used to generate the keysrandom
- the source of randomness for this generator- Throws:
java.security.InvalidAlgorithmParameterException
- if the given parameters are inappropriate for this key pair generator
-
initialize
public void initialize(int keysize, java.security.SecureRandom random) throws java.security.InvalidParameterException
Initializes the key pair generator for a certain key size, using the default parameter set. The generated keys will be stored in the CLEAR.- Specified by:
initialize
in classjava.security.KeyPairGeneratorSpi
- Parameters:
keysize
- the key size of the key to be generatedrandom
- the source of randomness for this generator- Throws:
java.security.InvalidParameterException
- when a parameter is not recognized
-
generateKeyPair
public java.security.KeyPair generateKeyPair()
Generates an Elliptic Curve key pair. The public key will be usable outside this provider. However, the private key will be stored either in a hardware associated file (PKDS) or as a clear token representation (CLEAR), and is therefore only usable by this provider on the machine that generated the key pair.- Specified by:
generateKeyPair
in classjava.security.KeyPairGeneratorSpi
- Returns:
- the newly generated Elliptic Curve key pair
-
-