Class Keytool

java.lang.Object
com.irurueta.authserver.testsupport.Keytool

final class Keytool extends Object
Runs the keytool of the JDK that runs the tests and cleans up the temporary directories its key stores live in; the JDK has no public API to issue a certificate. Shared by the generators of test certificates, so none of them keeps a key, a certificate or a key store beyond the time a test needs it.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final long
    Longest time keytool may take.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Not instantiable.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    delete(Path directory)
    Deletes a directory and what it holds, ignoring a failure.
    (package private) static void
    run(List<String> arguments)
    Runs keytool and waits for it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TIMEOUT_SECONDS

      private static final long TIMEOUT_SECONDS
      Longest time keytool may take.
      See Also:
  • Constructor Details

    • Keytool

      private Keytool()
      Not instantiable.
  • Method Details

    • run

      static void run(List<String> arguments) throws IOException
      Runs keytool and waits for it.
      Parameters:
      arguments - the arguments, without the executable.
      Throws:
      IOException - if it cannot run or fails.
    • delete

      static void delete(Path directory)
      Deletes a directory and what it holds, ignoring a failure.
      Parameters:
      directory - the directory, may be null.