Search in sources :

Example 1 with IDataObject

use of org.jcryptool.core.operations.dataobject.IDataObject in project core by jcryptool.

the class StartHandler method convert.

public IDataObject convert(ActionItem actionItem) {
    IDataObject dataobject = DataObjectConverter.hashtableToProperties(actionItem.getParams(), actionItem.getDataObjectType());
    if (dataobject instanceof ClassicDataObject) {
        AbstractAlphabet alphabet = AlphabetsManager.getInstance().getAlphabetByName(actionItem.getAlphabet());
        ((ClassicDataObject) dataobject).setAlphabet(alphabet);
        if ("encrypt".equals(actionItem.getActionType())) {
            // $NON-NLS-1$
            ((ClassicDataObject) dataobject).setOpmode(AbstractAlgorithm.ENCRYPT_MODE);
        } else if ("decrypt".equals(actionItem.getActionType())) {
            // $NON-NLS-1$
            ((ClassicDataObject) dataobject).setOpmode(AbstractAlgorithm.DECRYPT_MODE);
        }
    }
    return dataobject;
}
Also used : IDataObject(org.jcryptool.core.operations.dataobject.IDataObject) ClassicDataObject(org.jcryptool.core.operations.dataobject.classic.ClassicDataObject) AbstractAlphabet(org.jcryptool.core.operations.alphabets.AbstractAlphabet)

Aggregations

AbstractAlphabet (org.jcryptool.core.operations.alphabets.AbstractAlphabet)1 IDataObject (org.jcryptool.core.operations.dataobject.IDataObject)1 ClassicDataObject (org.jcryptool.core.operations.dataobject.classic.ClassicDataObject)1