All Packages Class Hierarchy This Package Previous Next Index
Class au.net.aba.crypto.provider.TwofishKeyFactory
java.lang.Object
|
+----javax.crypto.SecretKeyFactorySpi
|
+----au.net.aba.crypto.provider.TwofishKeyFactory
- public class TwofishKeyFactory
- extends SecretKeyFactorySpi
This class is used to convert Twofish keys into a format usable by the
usable by the ABA provider. The supported KeySpec classes are
TwofishKeySpec and SecretKeySpec. In the case of the SecretKeySpec
the key data must not be encoded. The supported Key class is
TwofishKey.
This class should not be instantiated directly, instead use the
java.security.KeyFactory interface.
- See Also:
- KeyFactory
-
ident
-
-
TwofishKeyFactory()
-
-
engineGenerateSecret(KeySpec)
- Generates a Twofish SecretKey object from the provided key
specification (key material).
-
engineGetKeySpec(SecretKey, Class)
- Returns a specification (key material) of the given key object.
-
engineTranslateKey(SecretKey)
- Translates an Twofish key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
ident
public static final String ident
TwofishKeyFactory
public TwofishKeyFactory()
engineGenerateSecret
protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException
- Generates a Twofish SecretKey object from the provided key
specification (key material). This class supports the
TwofishKeySpec and SecretKeySpec KeySpec classes.
- Returns:
- s The secret key.
- Throws: InvalidKeySpecException
- The provided KeySpec was not
a TwofishKeySpec or SecretKeySpec instance.
- Overrides:
- engineGenerateSecret in class SecretKeyFactorySpi
engineGetKeySpec
protected KeySpec engineGetKeySpec(SecretKey key,
Class keySpec) throws InvalidKeySpecException
- Returns a specification (key material) of the given key object.
keySpec identifies the specification class in which the key material
should be returned. It could, for example, be RSAPublicKeySpec.class,
to indicate that the key material should be returned in an instance
of the RSAPublicKeySpec class.
Can convert from an ABA TwofishKey into a SecretKeySpec or
TwofishKeySpec class.
- Parameters:
- key - the key the key material is to be recovered from.
- spec - the class the new key spec object is meant to be from.
- Returns:
- the new key spec object representing the key material in key.
- Throws: InvalidKeySpecException
- if the requested key
specification is inappropriate for the given key, or the given key
cannot be dealt with (e.g., the given key has an unrecognized
format).
- Overrides:
- engineGetKeySpec in class SecretKeyFactorySpi
engineTranslateKey
protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException
- Translates an Twofish key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
- Parameters:
- key - - the key whose provider is unknown or untrusted
- Returns:
- s the translated key
- Throws: InvalidKeyException
- if the given key cannot be processed
by this key factory.
- Overrides:
- engineTranslateKey in class SecretKeyFactorySpi
All Packages Class Hierarchy This Package Previous Next Index