Class javax.crypto.KeyGenerator
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.crypto.KeyGenerator

java.lang.Object
   |
   +----javax.crypto.KeyGenerator

public class KeyGenerator
extends Object

Variable Index

 o ident

Constructor Index

 o KeyGenerator(KeyGeneratorSpi, Provider, String)
Creates a KeyGenerator object using the given provider, KeyGeneratorSpi and for the specified algorithm.

Method Index

 o generateKey()
Generates a secret key.
 o getAlgorithm()
Returns the standard name of the key algorithm.
 o getInstance(String)
Generates a KeyGenerator object for the specified key algorithm.
 o getInstance(String, String)
Generates a KeyGenerator object for the specified key algorithm from the specified provider.
 o getProvider()
Returns the provider of this KeyGenerator object.
 o init(AlgorithmParameterSpec)
Initialises the key generator with the specified parameter set, using a system-provided source of randomness.
 o init(AlgorithmParameterSpec, SecureRandom)
Initialises the key generator with the specified parameter set and a user-provided source of randomness.
 o init(SecureRandom)
Initialises the key generator.

Variables

 o ident
  public final static String ident

Constructors

 o KeyGenerator
  protected KeyGenerator(KeyGeneratorSpi spi,
                         Provider provider,
                         String algorithm)
Creates a KeyGenerator object using the given provider, KeyGeneratorSpi and for the specified algorithm.
Parameters:
spi - the KeyGeneratorSpi to use
provider - the provider to use
algorithm - the standard name of the key algorithm. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.

Methods

 o getAlgorithm
  public final String getAlgorithm()
Returns the standard name of the key algorithm. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
Returns:
the standard algorithm name.
 o getInstance
  public static KeyGenerator getInstance(String algorithm) throws NoSuchAlgorithmException
Generates a KeyGenerator object for the specified key algorithm.
Parameters:
algorithm - the standard name of the requested key algorithm. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
Returns:
the new KeyGenerator object
Throws: NoSuchAlgorithmException
if a key generator for the requested algorithm is not available.
 o getInstance
  public static KeyGenerator getInstance(String algorithm,
                                         String provider) throws NoSuchAlgorithmException, NoSuchProviderException
Generates a KeyGenerator object for the specified key algorithm from the specified provider.
Parameters:
algorithm - the standard name of the requested key algorithm. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
Returns:
the new KeyGenerator object
Throws: NoSuchAlgorithmException
if a key generator for the requested algorithm is not available.
Throws: NoSuchProviderException
if the requested provider is not available
See Also:
Provider
 o getProvider
  public final Provider getProvider()
Returns the provider of this KeyGenerator object.
Returns:
the provider of this KeyGenerator object
 o init
  public void init(SecureRandom random)
Initialises the key generator.
Parameters:
random - the source of randomness for this generator.
 o init
  public void init(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException
Initialises the key generator with the specified parameter set, using a system-provided source of randomness.
Parameters:
params - the key generation parameters
Throws: InvalidAlgorithmParameterException
if the given parameters are inappropriate for this key generator.
 o init
  public void init(AlgorithmParameterSpec params,
                   SecureRandom random) throws InvalidAlgorithmParameterException
Initialises the key generator with the specified parameter set and a user-provided source of randomness.
Parameters:
params - the key generation parameters
random - the source of randomness for this key generator
Throws: InvalidAlgorithmParameterException
if params is inappropriate for this key generator.
 o generateKey
  public SecretKey generateKey()
Generates a secret key.
Returns:
the new key

All Packages  Class Hierarchy  This Package  Previous  Next  Index