Class RSAKeyPairGenerator


  • public class RSAKeyPairGenerator
    extends java.lang.Object
    Utility class used to generate a key pair for some process id on config/keys/publickey and config/keys/privatekey
    • Constructor Summary

      Constructors 
      Constructor Description
      RSAKeyPairGenerator()
      Creates a new instance of KeyPairGenerator
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)  
      void run​(int id, int size, java.lang.String provider)
      Generate the key pair for the process with id = and put it on the files config/keys/publickey and config/keys/privatekey
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RSAKeyPairGenerator

        public RSAKeyPairGenerator()
        Creates a new instance of KeyPairGenerator
    • Method Detail

      • run

        public void run​(int id,
                        int size,
                        java.lang.String provider)
                 throws java.lang.Exception
        Generate the key pair for the process with id = and put it on the files config/keys/publickey and config/keys/privatekey
        Parameters:
        id - the id of the process to generate key
        Throws:
        java.lang.Exception - something goes wrong when writing the files
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception