2

For some reason, JavaFX does not seem to currently support any algorithms for the Cipher cryptographic service when the application is executed after the self-contained deployment, as described here.

Given this code:

import java.security.Security;
import java.util.Iterator;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ListView;
import javafx.stage.Stage;



public final class Main extends Application
{
    @Override
    public void start(final Stage stage)
    {
        final ObservableList<String> ol = FXCollections.observableArrayList();
        final ListView<String> lv = new ListView(ol);

        for (final Iterator<String> iter = Security.getAlgorithms("Cipher").iterator(); iter.hasNext();)
            ol.add(iter.next());

        final Scene s = new Scene(lv, 500, 400);

        stage.setScene(s);
        stage.sizeToScene();
        stage.show();
    }
}

There is no problem getting populated output with various algorithms if this code is ran locally through the java launcher, but gives an empty list if the application has been packaged as self-contained.

However, I have also stumbled upon this:

Only a subset of Java Runtime is included by default. Some optional and rarely used files are excluded to reduce the package size, such as all executables. If you need something that is not included by default, then you need to copy it in as a post-processing step. For installable packages, you can do this from the config script that is executed after populating the self-contained application folder. See Section 6.3.3, "Customization Using Drop-In Resources."

Could the quoted paragraph be the probable cause? What kind of workaround would be needed in order to get this functionality included into the self-contained runtime?

Thank you.

ludwig
  • 23
  • 2
  • Could you package your app with an external `Provider` such as bouncy castle? – Qwerky Jul 30 '13 at 15:21
  • I believe that might be a plausible option, even though, to be frank, I'd prefer a native solution that resides in the **JDK**, instead of relying on external dependencies. I will try researching this particular matter more and if unsuccessful - I will try the libs provided by the bouncy castle. Thank you for your comment. – ludwig Jul 30 '13 at 15:30
  • 2
    Looking at https://blogs.oracle.com/talkingjavadeployment/entry/native_packaging_cookbook_using_drop the bundled JCE isn't packaged by default. – Qwerky Jul 30 '13 at 15:36
  • @Qwerky Sounds like enough info for a self-contained answer :P – Maarten Bodewes Jul 30 '13 at 21:20
  • @Qwerky if you don't mind - add your comment as an answer so I could accept it. – ludwig Aug 06 '13 at 14:51

1 Answers1

0

Looking at this link the bundled JCE isn't packaged by default.

Qwerky
  • 18,217
  • 6
  • 44
  • 80