au.net.aba.crypto.provider
Class BlowfishKeyFactory

java.lang.Object
  |
  +--javax.crypto.SecretKeyFactorySpi
        |
        +--au.net.aba.crypto.provider.BlowfishKeyFactory

public class BlowfishKeyFactory
extends SecretKeyFactorySpi

This class is used to convert Blowfish keys into a format usable by the usable by the ABA provider. The supported KeySpec classes are BlowfishKeySpec and SecretKeySpec. In the case of the SecretKeySpec the key data must not be encoded. The supported Key class is BlowfishKey.

This class should not be instantiated directly, instead use the java.security.KeyFactory interface.

See Also:
java.security.KeyFactory

Field Summary
static java.lang.String ident
           
 
Constructor Summary
BlowfishKeyFactory()
           
 
Method Summary
protected  SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec)
          Generates a Blowfish SecretKey object from the provided key specification (key material).
protected  java.security.spec.KeySpec engineGetKeySpec(SecretKey key, java.lang.Class keySpec)
          Returns a specification (key material) of the given key object in the requested format.
protected  SecretKey engineTranslateKey(SecretKey key)
          Translates an Blowfish key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ident

public static final java.lang.String ident
Constructor Detail

BlowfishKeyFactory

public BlowfishKeyFactory()
Method Detail

engineGenerateSecret

protected SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec)
                                  throws java.security.spec.InvalidKeySpecException
Generates a Blowfish SecretKey object from the provided key specification (key material). This class supports the BlowfishKeySpec and SecretKeySpec KeySpec class.
Throws:
java.security.spec.InvalidKeySpecException - The provided KeySpec was not a BlowfishKeySpec or SecretKeySpec instance.
Overrides:
engineGenerateSecret in class SecretKeyFactorySpi

engineGetKeySpec

protected java.security.spec.KeySpec engineGetKeySpec(SecretKey key,
                                                      java.lang.Class keySpec)
                                               throws java.security.spec.InvalidKeySpecException
Returns a specification (key material) of the given key object in the requested format.

Can convert from an ABA Blowfish Key into a SecretKeySpec or a BlowfishKeySpec.

Parameters:
key - the key
keySpec - the requested format in which the key material shall be returned
Throws:
java.security.spec.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 unrecognised format).
Overrides:
engineGetKeySpec in class SecretKeyFactorySpi

engineTranslateKey

protected SecretKey engineTranslateKey(SecretKey key)
                                throws java.security.InvalidKeyException
Translates an Blowfish 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
Throws:
java.security.InvalidKeyException - if the given key cannot be processed by this key factory.
Overrides:
engineTranslateKey in class SecretKeyFactorySpi