use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.blockcipher.BlockCipherWizard in project core by jcryptool.
the class AlgorithmsManager method performBlockCipherCalled.
private static void performBlockCipherCalled(IMetaAlgorithm algorithm) {
blockCipherWizard = new BlockCipherWizard(algorithm);
dialog = new BlockCipherWizardDialog(shell, blockCipherWizard);
dialog.setMinimumPageSize(300, 175);
int result = dialog.open();
if (result == Window.OK) {
NewOperationManager.getInstance().fireNewOperation(blockCipherWizard.getDescriptor());
}
}
use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.blockcipher.BlockCipherWizard in project core by jcryptool.
the class AlgorithmsManager method performMacCalled.
private static void performMacCalled(IMetaAlgorithm algorithm) {
if (algorithm.getBlockCipherName() != null) {
IMetaAlgorithm bc = null;
// $NON-NLS-1$
LogUtil.logInfo("BC name: " + algorithm.getBlockCipherName());
if (algorithm.getBlockCipherOID() != null) {
// $NON-NLS-1$
LogUtil.logInfo("BC oid: " + algorithm.getBlockCipherOID());
bc = AlgorithmsXMLManager.getInstance().getBlockCipher(algorithm.getBlockCipherOID());
} else {
bc = AlgorithmsXMLManager.getInstance().getBlockCipher(algorithm.getBlockCipherName());
}
// $NON-NLS-1$
LogUtil.logInfo("BC mode: " + algorithm.getBlockCipherMode());
if (bc != null) {
blockCipherWizard = new BlockCipherWizard(bc, algorithm.getBlockCipherMode());
dialog = new BlockCipherWizardDialog(shell, blockCipherWizard);
dialog.setMinimumPageSize(300, 175);
int result = dialog.open();
if (result == Window.OK) {
AlgorithmDescriptor blockCipherDescriptor = blockCipherWizard.getDescriptor();
AlgorithmDescriptor macDescriptor = new AlgorithmDescriptor(algorithm.getName(), RegistryType.MAC, blockCipherDescriptor.getAlgorithmParameterSpec());
NewOperationManager.getInstance().fireNewOperation(macDescriptor);
return;
}
}
}
if (algorithm.getParameterSpecClassName() != null && !algorithm.isParameterSpecDisabled()) {
algorithmWizard = new AlgorithmWizard(algorithm);
dialog = new WizardDialog(shell, algorithmWizard);
dialog.setMinimumPageSize(300, 100);
int result = dialog.open();
if (result == Window.OK) {
// $NON-NLS-1$
LogUtil.logInfo("adding mac");
NewOperationManager.getInstance().fireNewOperation(algorithmWizard.getDescriptor());
} else {
// $NON-NLS-1$
LogUtil.logInfo("adding mac w/o parameter spec");
// $NON-NLS-1$
LogUtil.logInfo("has param generator: " + (algorithm.getParameterGeneratorClassName() != null));
if (algorithm.getParameterGeneratorClassName() != null) {
AlgorithmParameterSpec generatedSpec = Reflector.getInstance().generateDefaultParameterSpec(algorithm);
NewOperationManager.getInstance().fireNewOperation(new AlgorithmDescriptor(algorithm.getName(), RegistryType.MAC, generatedSpec));
} else {
NewOperationManager.getInstance().fireNewOperation(new AlgorithmDescriptor(algorithm.getName(), RegistryType.MAC, null));
}
}
}
}
Aggregations