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
-
ident
-
-
DHKeyFactory()
-
-
engineGeneratePrivate(KeySpec)
- Generates a Diffie-Hellman PrivateKey object from the provided key
specification (key material).
-
engineGeneratePublic(KeySpec)
- Generates a Diffie-Hellman PublicKey object from the provided key
specification (key material).
-
engineGetKeySpec(Key, Class)
- Returns a specification (key material) of the given key object in
the requested format.
-
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.
ident
public static final String ident
DHKeyFactory
public DHKeyFactory()
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
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
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
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