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.

Variable Index

 o ident

Constructor Index

 o KeyFactory()

Method Index

 o engineGeneratePrivate(KeySpec)
SPI: Generates a private key object from the provided key specification (key material).
 o engineGeneratePublic(KeySpec)
SPI: Generates a public key object from the provided key specification (key material).
 o engineGetKeySpec(Key, Class)
SPI: Returns a specification (key material) of the given key object.
 o engineTranslateKey(Key)
SPI: Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.
 o generatePrivate(KeySpec)
Generates a private key object from the provided key specification (key material).
 o generatePublic(KeySpec)
Generates a public key object from the provided key specification (key material).
 o getInstance(String)
Generates a KeyFactory object for the specified algorithm.
 o getInstance(String, String)
Generates a KeyFactory object for the specified algorithm from the specified provider.
 o getKeySpec(Key, Class)
Returns a specification (key material) of the given key object.
 o translateKey(Key)
Translates a key object, whose provider may be unknown or potentially untrusted, into a corresponding key object of this key factory.

Variables

 o ident
  public final static String ident

Constructors

 o KeyFactory
  public KeyFactory()

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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