Package java.security

Class KeyPairGeneratorSpi

java.lang.Object
java.security.KeyPairGeneratorSpi
Direct Known Subclasses:
KeyPairGenerator, OpenSSLDSAKeyPairGenerator, OpenSSLRSAKeyPairGenerator

public abstract class KeyPairGeneratorSpi
extends Object
KeyPairGeneratorSpi is the Service Provider Interface (SPI) definition for KeyPairGenerator.
See Also:
KeyPairGenerator
  • Constructor Details

    • KeyPairGeneratorSpi

      public KeyPairGeneratorSpi()
      Constructs a new instance of KeyPairGeneratorSpi.
  • Method Details

    • generateKeyPair

      public abstract KeyPair generateKeyPair()
      Computes and returns a new unique KeyPair each time this method is called.
      Returns:
      a new unique KeyPair each time this method is called.
    • initialize

      public abstract void initialize​(int keysize, SecureRandom random)
      Initializes this KeyPairGeneratorSpi with the given key size and the given SecureRandom. 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 this KeyPairGeneratorSpi with the given AlgorithmParameterSpec and the given SecureRandom.
      Parameters:
      params - the parameters to use.
      random - the source of randomness.
      Throws:
      InvalidAlgorithmParameterException - if the specified parameters are not supported.