All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.provider.DHKeyFactory

java.lang.Object
   |
   +----au.net.aba.security.KeyFactorySpi
           |
           +----au.net.aba.crypto.provider.DHKeyFactory

public class DHKeyFactory
extends KeyFactorySpi
This class is used to convert Diffie-Hellman keys into a format usable by the ABA provider. Currently this class can only convert from a KeySpec into a Key. The supported KeySpec classes are DHPublicKeySpec and DHPrivateKeySpec.

Not currently finished.

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

See Also:
KeyFactory

Variable Index

 o ident

Constructor Index

 o DHKeyFactory()

Method Index

 o engineGeneratePrivate(KeySpec)
Generates a Diffie-Hellman PrivateKey object from the provided key specification (key material).
 o engineGeneratePublic(KeySpec)
Generates a Diffie-Hellman PublicKey object from the provided key specification (key material).
 o engineGetKeySpec(Key, Class)
Returns a specification (key material) of the given key object in the requested format.
 o engineTranslateKey(Key)
Translates a Diffie-Hellman key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.

Variables

 o ident
 public static final String ident

Constructors

 o DHKeyFactory
 public DHKeyFactory()

Methods

 o engineGeneratePrivate
 protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
Generates a Diffie-Hellman PrivateKey object from the provided key specification (key material). This class supports the DHPrivateKeySpec KeySpec class.

Returns:
s The private key.
Throws: InvalidKeySpecException
The provided KeySpec was not a DHPrivateKeySpec KeySpec.
Overrides:
engineGeneratePrivate in class KeyFactorySpi
 o engineGeneratePublic
 protected PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
Generates a Diffie-Hellman PublicKey object from the provided key specification (key material). This class supports the DHPublicKeySpec KeySpec class.

Returns:
s The private key.
Throws: InvalidKeySpecException
The provided KeySpec was not a DHPublicKeySpec KeySpec.
Overrides:
engineGeneratePublic in class KeyFactorySpi
 o engineGetKeySpec
 protected KeySpec engineGetKeySpec(Key key,
                                    Class spec) throws InvalidKeySpecException
Returns a specification (key material) of the given key object in the requested format.

Currently supports standard DH keys, DHPublicKeySpec and DHPrivateKeySpec KeySpec classes.

Parameters:
key - the key
keySpec - the requested format in which the key material shall be returned
Returns:
s the underlying key specification (key material) in the requested format
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 unrecognised format).
Overrides:
engineGetKeySpec in class KeyFactorySpi
 o engineTranslateKey
 protected Key engineTranslateKey(Key key) throws InvalidKeyException
Translates a Diffie-Hellman 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 KeyFactorySpi

All Packages  Class Hierarchy  This Package  Previous  Next  Index