anon.crypto
Class DSAKeyPool

java.lang.Object
  extended by anon.crypto.DSAKeyPool

public class DSAKeyPool
extends java.lang.Object

This class starts a thread that will create DSA key pairs in the background with a low priority. The keys may be popped for further use, while new key pairs will always be created to replace the popped ones.

Author:
Rolf Wendolsky

Nested Class Summary
private  class DSAKeyPool.KeyCreationThread
           
 
Field Summary
private  boolean m_bInterrupted
           
private  int m_certainty
           
private  java.lang.Thread m_keyCreationThread
           
private  int m_keyLength
           
private  java.util.Vector m_keys
           
private  int m_poolSize
           
 
Constructor Summary
DSAKeyPool()
           
DSAKeyPool(int a_poolsize)
           
 
Method Summary
 AsymmetricCryptoKeyPair popKeyPair()
          Pop a key pair from the stack.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_keyCreationThread

private java.lang.Thread m_keyCreationThread

m_keys

private java.util.Vector m_keys

m_bInterrupted

private boolean m_bInterrupted

m_poolSize

private int m_poolSize

m_certainty

private int m_certainty

m_keyLength

private int m_keyLength
Constructor Detail

DSAKeyPool

public DSAKeyPool(int a_poolsize)

DSAKeyPool

public DSAKeyPool()
Method Detail

start

public void start()

stop

public void stop()

popKeyPair

public AsymmetricCryptoKeyPair popKeyPair()
Pop a key pair from the stack. The creation of a new key pair will start immediately in the background. If no key pair is currently available, this method will block until there is one. It the thread has been stopped, this method will return null.

Returns:
the first key pair popped from the queue or null if the pool has been stopped