com.ibm.crypto.fips.provider

Class DESedeKeyGenerator

  • java.lang.Object
    • javax.crypto.KeyGeneratorSpi
      • com.ibm.crypto.fips.provider.DESedeKeyGenerator


  • public final class DESedeKeyGenerator
    extends javax.crypto.KeyGeneratorSpi
    This class generates a Triple DES key.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DESedeKeyGenerator()
      Verify the JCE framework in the constructor.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected javax.crypto.SecretKey engineGenerateKey()
      Generates the Triple DES key.
      protected void engineInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
      Initializes this key generator with the specified parameter set and a user-provided source of randomness.
      protected void engineInit(int keysize, java.security.SecureRandom random)
      Initializes this key generator for a certain keysize, using the given source of randomness.
      protected void engineInit(java.security.SecureRandom random)
      Initializes this key generator.
      protected void finalize()
      This function resets the class variables.
      protected javax.crypto.SecretKey internalGenerateKey()
      Generates the Triple DES key.
      protected void internalInit(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
      Initializes this key generator with the specified parameter set and a user-provided source of randomness.
      protected void internalInit(int keysize, java.security.SecureRandom random)
      Initializes this key generator for a certain keysize, using the given source of randomness.
      protected void internalInit(java.security.SecureRandom random)
      Initializes this key generator.
      • Methods inherited from class java.lang.Object

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

      • DESedeKeyGenerator

        public DESedeKeyGenerator()
        Verify the JCE framework in the constructor.
        Throws:
        java.lang.SecurityException - if fails to verify the JCE framework.
    • Method Detail

      • engineInit

        protected void engineInit(java.security.SecureRandom random)
        Initializes this key generator.
        Specified by:
        engineInit in class javax.crypto.KeyGeneratorSpi
        Parameters:
        random - the source of randomness for this generator
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalInit

        protected void internalInit(java.security.SecureRandom random)
        Initializes this key generator.
        Parameters:
        random - the source of randomness for this generator
      • engineInit

        protected void engineInit(java.security.spec.AlgorithmParameterSpec params,
                      java.security.SecureRandom random)
                           throws java.security.InvalidAlgorithmParameterException
        Initializes this key generator with the specified parameter set and a user-provided source of randomness.
        Specified by:
        engineInit in class javax.crypto.KeyGeneratorSpi
        Parameters:
        params - the key generation parameters
        random - the source of randomness for this key generator
        Throws:
        java.security.InvalidAlgorithmParameterException - if params is inappropriate for this key generator
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalInit

        protected void internalInit(java.security.spec.AlgorithmParameterSpec params,
                        java.security.SecureRandom random)
                             throws java.security.InvalidAlgorithmParameterException
        Initializes this key generator with the specified parameter set and a user-provided source of randomness.
        Parameters:
        params - the key generation parameters
        random - the source of randomness for this key generator
        Throws:
        java.security.InvalidAlgorithmParameterException - if params is inappropriate for this key generator
      • engineInit

        protected void engineInit(int keysize,
                      java.security.SecureRandom random)
        Initializes this key generator for a certain keysize, using the given source of randomness.
        Specified by:
        engineInit in class javax.crypto.KeyGeneratorSpi
        Parameters:
        keysize - the keysize. This is an algorithm-specific metric specified in number of bits. A keysize with 112 bits of entropy corresponds to a Triple DES key with 2 intermediate keys, and a keysize with 168 bits of entropy corresponds to a Triple DES key with 3 intermediate keys.
        random - the source of randomness for this key generator
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalInit

        protected void internalInit(int keysize,
                        java.security.SecureRandom random)
        Initializes this key generator for a certain keysize, using the given source of randomness.
        Parameters:
        keysize - the keysize. This is an algorithm-specific metric specified in number of bits. A keysize with 112 bits of entropy corresponds to a Triple DES key with 2 intermediate keys, and a keysize with 168 bits of entropy corresponds to a Triple DES key with 3 intermediate keys.
        random - the source of randomness for this key generator
      • engineGenerateKey

        protected javax.crypto.SecretKey engineGenerateKey()
        Generates the Triple DES key.
        Specified by:
        engineGenerateKey in class javax.crypto.KeyGeneratorSpi
        Returns:
        the new Triple DES key
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGenerateKey

        protected javax.crypto.SecretKey internalGenerateKey()
        Generates the Triple DES key.
        Returns:
        the new Triple DES key
      • finalize

        protected void finalize()
        This function resets the class variables.
        Overrides:
        finalize in class java.lang.Object
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.