Class KeyPairGenerator

java.lang.Object
org.qubership.atp.crypt.KeyPairGenerator

public class KeyPairGenerator extends Object
  • Constructor Details

    • KeyPairGenerator

      public KeyPairGenerator()
  • Method Details

    • generateKeys

      public KeyEntity generateKeys() throws Exception
      Generation of RSA and AES keys.
      Returns:
      KeyEntity - key entity generated.
      Throws:
      Exception
    • generateKeys

      public KeyEntity generateKeys(String key) throws Exception
      Generation of RSA and encryption the incoming AES key.
      Parameters:
      key - the key
      Returns:
      the key entity
      Throws:
      Exception - the exception
    • main

      public static void main(String[] arg) throws Exception
      To generate pair key from console.
      Parameters:
      arg - the input arguments
      Throws:
      Exception - the exception
    • readPublicKey

      public Object readPublicKey(String publicKey) throws Exception
      Read the base32 form of a public key.
      Parameters:
      publicKey - - Key String to read from
      Returns:
      Object key.
      Throws:
      Exception
    • readPrivateKey

      public Object readPrivateKey(String privateKeyString) throws Exception
      Read the base32 form of a private key.
      Parameters:
      privateKeyString - - Key String to read from
      Returns:
      Object key.
      Throws:
      Exception
    • readKey

      public Object readKey(String keyString) throws Exception
      Read the base32 form of an AES key.
      Parameters:
      keyString - - Key String to read from
      Returns:
      Object key.
      Throws:
      Exception