Ejemplo n.º 1
0
  /**
   * Initializes the PSE environment.
   *
   * @throws KeyStoreException When the wrong keystore has been provided.
   * @throws IOException For errors related to processing the keystore.
   */
  public void initialize() throws KeyStoreException, IOException {

    Logging.logCheckedInfo(LOG, "Initializing new PSE keystore...");

    synchronized (keystore_manager) {
      try {

        if (keystore_manager.isInitialized(keystore_password)) return;

        keystore_manager.createKeyStore(keystore_password);

      } catch (KeyStoreException failed) {

        Logging.logCheckedSevere(LOG, "Failure accessing or creating keystore.\n", failed);
        keystore_manager.eraseKeyStore();
        throw failed;
      }
    }
  }
Ejemplo n.º 2
0
 /**
  * Removes an existing PSE enviroment.
  *
  * @throws IOException If the PSE cannot be successfully deleted.
  */
 public void erase() throws IOException {
   synchronized (keystore_manager) {
     keystore_manager.eraseKeyStore();
   }
 }