Package java.security
Class KeyPairGeneratorSpi
- java.lang.Object
-
- java.security.KeyPairGeneratorSpi
-
- Direct Known Subclasses:
KeyPairGenerator,OpenSSLRSAKeyPairGenerator
public abstract class KeyPairGeneratorSpi extends Object
KeyPairGeneratorSpiis the Service Provider Interface (SPI) definition forKeyPairGenerator.- See Also:
KeyPairGenerator
-
-
Constructor Summary
Constructors Constructor Description KeyPairGeneratorSpi()Constructs a new instance ofKeyPairGeneratorSpi.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract KeyPairgenerateKeyPair()Computes and returns a new uniqueKeyPaireach time this method is called.abstract voidinitialize(int keysize, SecureRandom random)Initializes thisKeyPairGeneratorSpiwith the given key size and the givenSecureRandom.voidinitialize(AlgorithmParameterSpec params, SecureRandom random)Initializes thisKeyPairGeneratorSpiwith the givenAlgorithmParameterSpecand the givenSecureRandom.
-
-
-
Method Detail
-
generateKeyPair
public abstract KeyPair generateKeyPair()
Computes and returns a new uniqueKeyPaireach time this method is called.- Returns:
- a new unique
KeyPaireach time this method is called.
-
initialize
public abstract void initialize(int keysize, SecureRandom random)Initializes thisKeyPairGeneratorSpiwith the given key size and the givenSecureRandom. The default parameter set will be used.- Parameters:
keysize- the key size (number of bits).random- the source of randomness.
-
initialize
public void initialize(AlgorithmParameterSpec params, SecureRandom random) throws InvalidAlgorithmParameterException
Initializes thisKeyPairGeneratorSpiwith the givenAlgorithmParameterSpecand the givenSecureRandom.- Parameters:
params- the parameters to use.random- the source of randomness.- Throws:
InvalidAlgorithmParameterException- if the specified parameters are not supported.
-
-