au.net.aba.crypto.provider
Class RC5SecretKeyFactory

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

public class RC5SecretKeyFactory
extends SecretKeyFactorySpi

Implements the Secret key factory for RC5. This class supports classes of type RC5KeySpec & SecretKeySpec.


Constructor Summary
RC5SecretKeyFactory()
           
 
Method Summary
protected  SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec)
          Generates a RC5 Secret key from the provided secret key material.
protected  java.security.spec.KeySpec engineGetKeySpec(SecretKey key, java.lang.Class keySpec)
          Returns the specification of the given key in the requested format.
protected  SecretKey engineTranslateKey(SecretKey key)
          Attempts to translate the given key object to a trusted key
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC5SecretKeyFactory

public RC5SecretKeyFactory()
Method Detail

engineGenerateSecret

protected SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec)
                                  throws java.security.spec.InvalidKeySpecException
Generates a RC5 Secret key from the provided secret key material.

Overrides:
engineGenerateSecret in class SecretKeyFactorySpi
Returns:
a new RC5 secret key
Throws:
java.security.spec.InvalidKeySpecException - if the provided keySpec is not of type RC5KeySpec & SecretKeySpec.

engineTranslateKey

protected SecretKey engineTranslateKey(SecretKey key)
                                throws java.security.InvalidKeyException
Attempts to translate the given key object to a trusted key

Overrides:
engineTranslateKey in class SecretKeyFactorySpi
Parameters:
key - secret key to translate
Returns:
a new secret key
Throws:
java.security.InvalidKeyException - if key cannot be translated

engineGetKeySpec

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

Overrides:
engineGetKeySpec in class SecretKeyFactorySpi
Parameters:
key - the key
keySpec - the requested format in which the key material is to be returned
Returns:
the underlying key specification (key material) in the requested format
Throws:
java.security.spec.InvalidKeySpecException - if the requested key specification is inappropriate for the given key