Package java.security

Class KeyFactorySpi

java.lang.Object
java.security.KeyFactorySpi
Direct Known Subclasses:
BaseKeyFactorySpi, DSAKeyFactoryImpl, KeyFactory, OpenSSLDSAKeyFactory, OpenSSLECKeyFactory, OpenSSLRSAKeyFactory

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

    • KeyFactorySpi

      public KeyFactorySpi()
  • Method Details

    • engineGeneratePublic

      protected abstract PublicKey engineGeneratePublic​(KeySpec keySpec) throws InvalidKeySpecException
      Generates a instance of PublicKey from the given key specification.
      Parameters:
      keySpec - the specification of the public key.
      Returns:
      the public key.
      Throws:
      InvalidKeySpecException - if the specified keySpec is invalid.
    • engineGeneratePrivate

      protected abstract PrivateKey engineGeneratePrivate​(KeySpec keySpec) throws InvalidKeySpecException
      Generates a instance of PrivateKey from the given key specification.
      Parameters:
      keySpec - the specification of the private key.
      Returns:
      the private key.
      Throws:
      InvalidKeySpecException - if the specified keySpec is invalid.
    • engineGetKeySpec

      protected abstract <T extends KeySpec> T engineGetKeySpec​(Key key, Class<T> keySpec) throws InvalidKeySpecException
      Returns the key specification for the specified key.
      Parameters:
      key - the key from which the specification is requested.
      keySpec - the type of the requested KeySpec.
      Returns:
      the key specification for the specified key.
      Throws:
      InvalidKeySpecException - if the key can not be processed, or the requested requested KeySpec is inappropriate for the given key.
    • engineTranslateKey

      protected abstract Key engineTranslateKey​(Key key) throws InvalidKeyException
      Translates the given key into a key from this key factory.
      Parameters:
      key - the key to translate.
      Returns:
      the translated key.
      Throws:
      InvalidKeyException - if the specified key can not be translated by this key factory.