Class RsaKeyProvider

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • RsaKeyProvider

        public RsaKeyProvider()
        Creates the provider.
      • RsaKeyProvider

        public RsaKeyProvider​(int keysize)
        Creates the provider.
      • RsaKeyProvider

        public RsaKeyProvider​(int keysize,
                              int maxkeys)
        Creates the provider.
    • 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 interface IKeyProvider
        Returns:
        Key pair.