Class DSAKeyFactoryImpl

java.lang.Object
java.security.KeyFactorySpi
org.apache.harmony.security.provider.crypto.DSAKeyFactoryImpl

public class DSAKeyFactoryImpl
extends KeyFactorySpi
  • Constructor Details

    • DSAKeyFactoryImpl

      public DSAKeyFactoryImpl()
  • Method Details

    • engineGeneratePrivate

      protected PrivateKey engineGeneratePrivate​(KeySpec keySpec) throws InvalidKeySpecException
      This method generates a DSAPrivateKey object from the provided key specification.
      Specified by:
      engineGeneratePrivate in class KeyFactorySpi
      Parameters:
      keySpec - - the specification (key material) for the DSAPrivateKey.
      Returns:
      a DSAPrivateKey object
      Throws:
      InvalidKeySpecException - if "keySpec" is neither DSAPrivateKeySpec nor PKCS8EncodedKeySpec
    • engineGeneratePublic

      protected PublicKey engineGeneratePublic​(KeySpec keySpec) throws InvalidKeySpecException
      This method generates a DSAPublicKey object from the provided key specification.
      Specified by:
      engineGeneratePublic in class KeyFactorySpi
      Parameters:
      keySpec - - the specification (key material) for the DSAPublicKey.
      Returns:
      a DSAPublicKey object
      Throws:
      InvalidKeySpecException - if "keySpec" is neither DSAPublicKeySpec nor X509EncodedKeySpec
    • engineGetKeySpec

      protected <T extends KeySpec> T engineGetKeySpec​(Key key, Class<T> keySpec) throws InvalidKeySpecException
      This method returns a specification for the supplied key. The specification will be returned in the form of an object of the type specified by keySpec.
      Specified by:
      engineGetKeySpec in class KeyFactorySpi
      Parameters:
      key - - either DSAPrivateKey or DSAPublicKey
      keySpec - - either DSAPrivateKeySpec.class or DSAPublicKeySpec.class
      Returns:
      either a DSAPrivateKeySpec or a DSAPublicKeySpec
      Throws:
      InvalidKeySpecException - if "keySpec" is not a specification for DSAPublicKey or DSAPrivateKey
    • engineTranslateKey

      protected Key engineTranslateKey​(Key key) throws InvalidKeyException
      The method generates a DSAPublicKey object from the provided key.
      Specified by:
      engineTranslateKey in class KeyFactorySpi
      Parameters:
      key - - a DSAPublicKey object or DSAPrivateKey object.
      Returns:
      object of the same type as the "key" argument
      Throws:
      InvalidKeyException - if "key" is neither DSAPublicKey nor DSAPrivateKey