com.ibm.crypto.pkcs11impl.provider

Class DHPKCS11KeyPairGenerator

  • java.lang.Object
    • java.security.KeyPairGeneratorSpi
      • com.ibm.crypto.pkcs11impl.provider.DHPKCS11KeyPairGenerator


  • public final class DHPKCS11KeyPairGenerator
    extends java.security.KeyPairGeneratorSpi
    This class represents the key pair generator for Diffie-Hellman key pairs.

    This key pair generator may be initialized in two different ways:

    • By providing the size in bits of the prime modulus. This will be used to create a prime modulus and base generator, which will then be used to create the Diffie-Hellman key pair.
    • By providing a prime modulus and base generator.
    Version:
    1.0, 19/1/2005
    See Also:
    KeyPairGenerator
    • Constructor Summary

      Constructors 
      Constructor and Description
      DHPKCS11KeyPairGenerator(java.security.Provider provider)
      Creates the Key pair generator for Diffie-Hellman
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.security.KeyPair generateKeyPair()
      Generates a key pair.
      void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
      Initializes this key pair generator using Parameter spec and source of randomness.
      void initialize(int keysize, java.security.SecureRandom random)
      Initializes this key pair generator for a certain keysize and source of randomness.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DHPKCS11KeyPairGenerator

        public DHPKCS11KeyPairGenerator(java.security.Provider provider)
        Creates the Key pair generator for Diffie-Hellman
        Parameters:
        provider - the provider associated with this object.
    • Method Detail

      • initialize

        public void initialize(int keysize,
                               java.security.SecureRandom random)
        Initializes this key pair generator for a certain keysize and source of randomness. The keysize is specified as the size in bits of the prime modulus.
        Specified by:
        initialize in class java.security.KeyPairGeneratorSpi
        Parameters:
        keysize - the keysize (size of prime modulus) in bits
        random - the source of randomness
      • generateKeyPair

        public java.security.KeyPair generateKeyPair()
        Generates a key pair.
        Specified by:
        generateKeyPair in class java.security.KeyPairGeneratorSpi
        Returns:
        the new key pair
      • initialize

        public void initialize(java.security.spec.AlgorithmParameterSpec params,
                               java.security.SecureRandom random)
                        throws java.security.InvalidAlgorithmParameterException
        Initializes this key pair generator using Parameter spec and source of randomness.
        Overrides:
        initialize in class java.security.KeyPairGeneratorSpi
        Parameters:
        params - This must be a DHParameterSpec
        random - the source of randomness
        Throws:
        java.security.InvalidAlgorithmParameterException

© Portions Copyright 2003, 2017 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2017, Oracle and/or its affiliates. All rights reserved.