com.ibm.crypto.fips.provider

Class DSAKeyFactory

  • java.lang.Object
    • java.security.KeyFactorySpi
      • com.ibm.crypto.fips.provider.DSAKeyFactory


  • public final class DSAKeyFactory
    extends java.security.KeyFactorySpi
    This class is a concrete implementaion of key factory for DSA.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DSAKeyFactory()
      Constructs a new instance of this class.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
      Generates a private key for the given key specification.
      protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
      Generates a public key for the given key specification.
      protected java.security.spec.KeySpec engineGetKeySpec(java.security.Key key, java.lang.Class keySpec)
      Answers a key specification for a given key.
      protected java.security.Key engineTranslateKey(java.security.Key key)
      This action is not allowed in this provider.
      protected java.security.PrivateKey internalGeneratePrivate(java.security.spec.KeySpec keySpec)
      Generates a private key for the given key specification.
      protected java.security.PublicKey internalGeneratePublic(java.security.spec.KeySpec keySpec)
      Generates a public key for the given key specification.
      protected java.security.spec.KeySpec internalGetKeySpec(java.security.Key key, java.lang.Class keySpec)
      Answers a key specification for a given key.
      • Methods inherited from class java.lang.Object

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

      • DSAKeyFactory

        public DSAKeyFactory()
        Constructs a new instance of this class.
    • Method Detail

      • engineGeneratePrivate

        protected java.security.PrivateKey engineGeneratePrivate(java.security.spec.KeySpec keySpec)
                                                          throws java.security.spec.InvalidKeySpecException
        Generates a private key for the given key specification.
        Specified by:
        engineGeneratePrivate in class java.security.KeyFactorySpi
        Parameters:
        keySpec - KeySpec the key specification to be used for key generation.
        Returns:
        PrivateKey the newly created DSA private key
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGeneratePrivate

        protected java.security.PrivateKey internalGeneratePrivate(java.security.spec.KeySpec keySpec)
                                                            throws java.security.spec.InvalidKeySpecException
        Generates a private key for the given key specification.
        Parameters:
        keySpec - KeySpec the key specification to be used for key generation.
        Returns:
        PrivateKey the newly created DSA private key
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
      • engineGeneratePublic

        protected java.security.PublicKey engineGeneratePublic(java.security.spec.KeySpec keySpec)
                                                        throws java.security.spec.InvalidKeySpecException
        Generates a public key for the given key specification.
        Specified by:
        engineGeneratePublic in class java.security.KeyFactorySpi
        Parameters:
        keySpec - KeySpec the key specification to be used for key generation.
        Returns:
        PublicKey the newly created public key
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGeneratePublic

        protected java.security.PublicKey internalGeneratePublic(java.security.spec.KeySpec keySpec)
                                                          throws java.security.spec.InvalidKeySpecException
        Generates a public key for the given key specification.
        Parameters:
        keySpec - KeySpec the key specification to be used for key generation.
        Returns:
        PublicKey the newly created public key
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
      • engineGetKeySpec

        protected java.security.spec.KeySpec engineGetKeySpec(java.security.Key key,
                                                  java.lang.Class keySpec)
                                                       throws java.security.spec.InvalidKeySpecException
        Answers a key specification for a given key.
        Specified by:
        engineGetKeySpec in class java.security.KeyFactorySpi
        Parameters:
        key - Key the key for which the specification is to be computed.
        keySpec - Class the class of the result specification
        Returns:
        a key specification for a given key. The class of the result object will be keySpec.
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGetKeySpec

        protected java.security.spec.KeySpec internalGetKeySpec(java.security.Key key,
                                                    java.lang.Class keySpec)
                                                         throws java.security.spec.InvalidKeySpecException
        Answers a key specification for a given key.
        Parameters:
        key - Key the key for which the specification is to be computed.
        keySpec - Class the class of the result specification
        Returns:
        a key specification for a given key. The class of the result object will be keySpec.
        Throws:
        java.security.spec.InvalidKeySpecException - if the provided key specification is not appropriate
      • engineTranslateKey

        protected java.security.Key engineTranslateKey(java.security.Key key)
                                                throws java.security.InvalidKeyException
        This action is not allowed in this provider. This method is only here to be complient wiht the SUN JCE JCK tests. If a key is passed in, this method will basically return it back to you without doing any work.
        Specified by:
        engineTranslateKey in class java.security.KeyFactorySpi
        Parameters:
        key - the key.
        Throws:
        java.security.InvalidKeyException - if the given key is null.
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.