Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.security.jce.sig
Class KeyPairGeneratorAdapter  view KeyPairGeneratorAdapter download KeyPairGeneratorAdapter.java

java.lang.Object
  extended byjava.security.KeyPairGeneratorSpi
      extended byjava.security.KeyPairGenerator
          extended bygnu.java.security.jce.sig.KeyPairGeneratorAdapter
Direct Known Subclasses:
DSSKeyPairGeneratorSpi, RSAKeyPairGeneratorSpi

public abstract class KeyPairGeneratorAdapter
extends java.security.KeyPairGenerator

The implementation of a generic java.security.KeyPairGenerator adapter class to wrap gnu.crypto keypair generator instances.

This class defines the Service Provider Interface (SPI) for the java.security.KeyPairGenerator class, which is used to generate pairs of public and private keys.

All the abstract methods in the java.security.KeyPairGeneratorSpi class are implemented by this class and all its sub-classes.

In case the client does not explicitly initialize the KeyPairGenerator (via a call to an initialize() method), the GNU Crypto provider supplies (and document) default values to be used. For example, the GNU Crypto provider uses a default modulus size (keysize) of 1024 bits for the DSS (Digital Signature Standard) a.k.a DSA.


Field Summary
protected  gnu.java.security.key.IKeyPairGenerator adaptee
          Our underlying keypair instance.
 
Fields inherited from class java.security.KeyPairGenerator
 
Constructor Summary
protected KeyPairGeneratorAdapter(java.lang.String kpgName)
          Trivial protected constructor.
 
Method Summary
 java.security.KeyPair generateKeyPair()
          Generates a new "DSA" java.security.KeyPair from the "GNU" security provider.
abstract  void initialize(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
          Initializes this instance with the specified java.security.spec.AlgorithmParameterSpec and java.security.SecureRandom.
abstract  void initialize(int keysize, java.security.SecureRandom random)
          Initializes this instance for the specified key size and java.security.SecureRandom.
 
Methods inherited from class java.security.KeyPairGenerator
genKeyPair, getAlgorithm, getInstance, getInstance, getInstance, getProvider, initialize, initialize
 
Methods inherited from class java.security.KeyPairGeneratorSpi
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adaptee

protected gnu.java.security.key.IKeyPairGenerator adaptee
Our underlying keypair instance.

Constructor Detail

KeyPairGeneratorAdapter

protected KeyPairGeneratorAdapter(java.lang.String kpgName)
Trivial protected constructor.

Method Detail

initialize

public abstract void initialize(int keysize,
                                java.security.SecureRandom random)
Description copied from class: java.security.KeyPairGenerator
Initializes this instance for the specified key size and java.security.SecureRandom.


initialize

public abstract void initialize(java.security.spec.AlgorithmParameterSpec params,
                                java.security.SecureRandom random)
                         throws java.security.InvalidAlgorithmParameterException
Description copied from class: java.security.KeyPairGenerator
Initializes this instance with the specified java.security.spec.AlgorithmParameterSpec and java.security.SecureRandom.


generateKeyPair

public java.security.KeyPair generateKeyPair()
Description copied from class: java.security.KeyPairGenerator
Generates a new "DSA" java.security.KeyPair from the "GNU" security provider.

This method generates a unique key pair each time it is called.