Class au.net.aba.security.KeyFactory
All Packages Class Hierarchy This Package Previous Next Index
Class au.net.aba.security.KeyFactory
java.lang.Object
|
+----au.net.aba.security.KeyFactory
- public class KeyFactory
- extends Object
A factory class for creating Keys.
-
ident
-
-
KeyFactory()
-
-
engineGeneratePrivate(KeySpec)
- SPI: Generates a private key object from the provided key
specification (key material).
-
engineGeneratePublic(KeySpec)
- SPI: Generates a public key object from the provided key
specification (key material).
-
engineGetKeySpec(Key, Class)
- SPI: Returns a specification (key material) of the given key object.
-
engineTranslateKey(Key)
- SPI: Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
-
generatePrivate(KeySpec)
- Generates a private key object from the provided key specification
(key material).
-
generatePublic(KeySpec)
- Generates a public key object from the provided key specification
(key material).
-
getInstance(String)
- Generates a KeyFactory object for the specified algorithm.
-
getInstance(String, String)
- Generates a KeyFactory object for the specified algorithm from the
specified provider.
-
getKeySpec(Key, Class)
- Returns a specification (key material) of the given key object.
-
translateKey(Key)
- Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
ident
public final static String ident
KeyFactory
public KeyFactory()
generatePrivate
public PrivateKey generatePrivate(KeySpec keySpec) throws InvalidKeySpecException
- Generates a private key object from the provided key specification
(key material).
- Parameters:
- keySpec - The specification (key material of the private key.
- Returns:
- s the private key.
- Throws: InvalidKeySpecException
- if the given key specification
is inappropriate for this key factory to produce a private key.
generatePublic
public PublicKey generatePublic(KeySpec keySpec) throws InvalidKeySpecException
- Generates a public key object from the provided key specification
(key material).
- Parameters:
- keySpec - - the specification (key material) of the
public key.
- Returns:
- s the public key.
- Throws: InvalidKeySpecException
- - if the given key
specification is inappropriate for this key factory to
produce a public key.
getInstance
public static KeyFactory getInstance(String algorithm) throws NoSuchAlgorithmException
- Generates a KeyFactory object for the specified algorithm. If the
default provider package contains a KeyFactory subclass for the
algorithm, an instance of that subclass is returned. If such a key
factory is not available in the default provider package, other
provider packages are searched.
- Parameters:
- algorithm - the name of the requested key algorithm. See
Appendix A in the Java Cryptography Architecture API
Specification & Reference for information about standard
algorithm names.
- Returns:
- a KeyFactory object for the specified algorithm.
- Throws: NoSuchAlgorithmException
- if the algorithm is not
available from the specified provider.
getInstance
public static KeyFactory getInstance(String algorithm,
String provider) throws NoSuchAlgorithmException, NoSuchProviderException
- Generates a KeyFactory object for the specified algorithm from the
specified provider.
- Parameters:
- algorithm - the name of the requested key algorithm. See
Appendix A in the Java Cryptography Architecture API
Specification & Reference for information about standard
algorithm names.
- provider - the name of the provider.
- Returns:
- a KeyFactory object for the specified algorithm.
- Throws: NoSuchAlgorithmException
- if the algorithm is not
available from the specified provider.
- Throws: NoSuchProviderException
- if the provider has not
been configured.
getKeySpec
public KeySpec getKeySpec(Key key,
Class keySpec)
- Returns a specification (key material) of the given key object.
keySpec identifies the specification class in which the key material
should be returned. It could, for example, be DSAPublicKeySpec.class,
to indicate that the key material should be returned in an instance
of the DSAPublicKeySpec class.
- Parameters:
- key - the key
- keySpec - the specification class in which the key material
should be returned.
translateKey
public Key translateKey(Key key)
- Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
engineGeneratePrivate
protected abstract PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException
- SPI: Generates a private key object from the provided key
specification (key material).
- Throws: InvalidKeySpecException
- - if the given key
specification is inappropriate for this key factory to
produce a private key.
engineGeneratePublic
protected abstract PublicKey engineGeneratePublic(KeySpec keySpec) throws InvalidKeySpecException
- SPI: Generates a public key object from the provided key
specification (key material).
- Throws: InvalidKeySpecException
- - if the given key
specification is inappropriate for this key factory to
produce a public key.
engineGetKeySpec
protected abstract KeySpec engineGetKeySpec(Key key,
Class keySpec)
- SPI: Returns a specification (key material) of the given key object.
keySpec identifies the specification class in which the key material
should be returned. It could, for example, be DSAPublicKeySpec.class,
to indicate that the key material should be returned in an instance
of the DSAPublicKeySpec class.
engineTranslateKey
protected abstract Key engineTranslateKey(Key key)
- SPI: Translates a key object, whose provider may be unknown or
potentially untrusted, into a corresponding key object of this key
factory.
All Packages Class Hierarchy This Package Previous Next Index