Class RsaKeyProvider
- java.lang.Object
-
- org.activecomponents.udp.asymciphers.RsaKeyProvider
-
- All Implemented Interfaces:
IKeyProvider
public class RsaKeyProvider extends java.lang.Object implements IKeyProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
DEFAULT_KEY_SIZE
The default key size.protected static int
DEFAULT_MAX_KEYS
The default maximum number of pre-gen keys.protected static java.math.BigInteger
EXP
RSA exponent.protected static boolean
PARALLEL_MODE
Generating keys in parallel.protected java.util.concurrent.BlockingQueue<org.bouncycastle.crypto.AsymmetricCipherKeyPair>
pregenkeys
Pre-generated keys.protected boolean
running
Running flag.protected java.util.concurrent.CyclicBarrier
shutdownbarrier
Barrier for coordinating shutdown.protected java.lang.Runnable
task
Generation task.
-
Constructor Summary
Constructors Constructor Description RsaKeyProvider()
Creates the provider.RsaKeyProvider(int keysize)
Creates the provider.RsaKeyProvider(int keysize, int maxkeys)
Creates the provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.crypto.AsymmetricCipherKeyPair
getKeyPair()
Returns a random key pair.void
start(IThreadExecutor texec)
Starts the key generation.void
stop()
Stops the key generation.
-
-
-
Field Detail
-
EXP
protected static final java.math.BigInteger EXP
RSA exponent.
-
DEFAULT_KEY_SIZE
protected static final int DEFAULT_KEY_SIZE
The default key size.- See Also:
- Constant Field Values
-
DEFAULT_MAX_KEYS
protected static final int DEFAULT_MAX_KEYS
The default maximum number of pre-gen keys.- See Also:
- Constant Field Values
-
PARALLEL_MODE
protected static final boolean PARALLEL_MODE
Generating keys in parallel.- See Also:
- Constant Field Values
-
pregenkeys
protected java.util.concurrent.BlockingQueue<org.bouncycastle.crypto.AsymmetricCipherKeyPair> pregenkeys
Pre-generated keys.
-
running
protected volatile boolean running
Running flag.
-
shutdownbarrier
protected java.util.concurrent.CyclicBarrier shutdownbarrier
Barrier for coordinating shutdown.
-
task
protected java.lang.Runnable task
Generation task.
-
-
Method Detail
-
start
public void start(IThreadExecutor texec)
Starts the key generation.
-
stop
public void stop()
Stops the key generation.
-
getKeyPair
public org.bouncycastle.crypto.AsymmetricCipherKeyPair getKeyPair()
Returns a random key pair.- Specified by:
getKeyPair
in interfaceIKeyProvider
- Returns:
- Key pair.
-
-