au.net.aba.crypto.provider
Class PBEKeyFactory
java.lang.Object
|
+--javax.crypto.SecretKeyFactorySpi
|
+--au.net.aba.crypto.provider.PBEKeyFactory
- public class PBEKeyFactory
- extends SecretKeyFactorySpi
This class is used to convert password based keys into a format
usable by the ABA provider. This class can convert PBEKeySpec
objects into an ABA PBEKey and visa versa.
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
|
Method Summary |
protected SecretKey |
engineGenerateSecret(java.security.spec.KeySpec keySpec)
Generates a PBE 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 a PBE 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 |
ident
public static final java.lang.String ident
PBEKeyFactory
public PBEKeyFactory()
engineGenerateSecret
protected SecretKey engineGenerateSecret(java.security.spec.KeySpec keySpec)
throws java.security.spec.InvalidKeySpecException
- Generates a PBE SecretKey object from the provided key specification
(key material). This class supports the PBEKeySpec KeySpec class.
- Throws:
- java.security.spec.InvalidKeySpecException - The provided KeySpec was not
a PBEKeySpec KeySpec.
- 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. Currently only the PBEKeySpec KeySpec
class is supported.
- Parameters:
key
- the keykeySpec
- the requested format in which the key material shall
be returned, must be PBEKeySpec.class- Throws:
- java.security.spec.InvalidKeySpecException - if the provided key
is not a PBEKey or the requested KeySpec is not a
PBEKeySpec.
- Overrides:
- engineGetKeySpec in class SecretKeyFactorySpi
engineTranslateKey
protected SecretKey engineTranslateKey(SecretKey key)
throws java.security.InvalidKeyException
- Translates a PBE 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