Skip to content
dschadow edited this page Dec 23, 2014 · 1 revision

The Actions view gives you the possibility to record cryptographic actions and to execute them again. Please be aware of the following points during your plug-in development so that your crypto plug-in integrates perfectly into the Actions view.

Every algorithm belongs to a Action class, which extends org.jcryptool.core.operations.algorithm.AbstractAlgorithmAction. This class does contain (besides some others) an abstract method public void run(IDataObject dataobject) which must be implemented by the concrete action class.

The configuration basis is the DataObject, which saves all parameters (settings) from the crypto wizard. The Actions view can only show and work with parameters that are contained in the DataObject.

Classic algorithms are using a ClassicDataObject, modern algorithms (regardless of their type) are using a ModernDataObject. Have a look at the following implementation samples. In order to integrate them into your crypto plug-in it is normally sufficient to replace the sample DataObject here with the one from your plug-in.

Sample for a classic algorithm implementation

@Override
public void run(IDataObject dataobject) {
  AbstractClassicAlgorithm algorithm = new AdfgvxAlgorithm();

  ClassicDataObject d = (ClassicDataObject) dataobject;
  algorithm.init(d);

  super.finalizeRun(algorithm);
}

Sample for a modern algorithm implementation

@Override
public void run(IDataObject dataobject) {
  DragonAlgorithm algorithm = new DragonAlgorithm();

  algorithm.dataObject = (SymmetricDataObject) dataobject;

  super.finalizeRun(algorithm);
}