use of org.jcryptool.core.operations.dataobject.classic.ClassicDataObject in project core by jcryptool.
the class AbstractClassicAlgorithm method init.
/**
* Initializes the Algorithm with its key parameters
*
* @param opmode encrypt or decrypt (mode)
* @param input input text
* @param alphabet filter alphabet
* @param key the operation's key
* @param transformData the transformation data used to transform the text before the real operation, may be
* <code>null</code> in case no transformation should be applied
*/
public void init(int opmode, InputStream input, AbstractAlphabet alphabet, char[] key, TransformData transformData) {
this.dataObject = new ClassicDataObject();
this.dataObject.setTransformData(transformData);
try {
this.dataObject.setInputStream(filterStreamByTransformData(input, transformData));
} catch (Exception e) {
LogUtil.logError(OperationsPlugin.PLUGIN_ID, e);
this.dataObject.setInputStream(input);
}
this.dataObject.setAlphabet(alphabet);
this.dataObject.setKey(key);
this.dataObject.setOpmode(opmode);
}
Aggregations