use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.AlgorithmWizard in project core by jcryptool.
the class AlgorithmsManager method performCipherCalled.
private static void performCipherCalled(IMetaAlgorithm algorithm) {
if (algorithm.getParameterSpecClassName() != null) {
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 cipher");
NewOperationManager.getInstance().fireNewOperation(algorithmWizard.getDescriptor());
}
} else {
// $NON-NLS-1$
LogUtil.logInfo("adding cipher w/o parameter spec");
NewOperationManager.getInstance().fireNewOperation(new AlgorithmDescriptor(algorithm.getName(), RegistryType.ASYMMETRIC_BLOCK_CIPHER, null));
}
}
use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.AlgorithmWizard in project core by jcryptool.
the class AlgorithmsManager method performAsymmetricHybridCipherCalled.
private static void performAsymmetricHybridCipherCalled(IMetaAlgorithm algorithm) {
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 asymmetric hybrid cipher");
NewOperationManager.getInstance().fireNewOperation(algorithmWizard.getDescriptor());
}
} else {
// $NON-NLS-1$
LogUtil.logInfo("adding asymmetric hybrid cipher w/o parameter spec");
NewOperationManager.getInstance().fireNewOperation(new AlgorithmDescriptor(algorithm.getName(), RegistryType.ASYMMETRIC_HYBRID_CIPHER, null));
}
}
use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.AlgorithmWizard in project core by jcryptool.
the class AlgorithmsManager method performAsymmetricBlockCipherCalled.
private static void performAsymmetricBlockCipherCalled(IMetaAlgorithm algorithm) {
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 asymmetric block cipher");
NewOperationManager.getInstance().fireNewOperation(algorithmWizard.getDescriptor());
}
} else {
// $NON-NLS-1$
LogUtil.logInfo("adding asymmetric block cipher w/o parameter spec");
NewOperationManager.getInstance().fireNewOperation(new AlgorithmDescriptor(algorithm.getName(), RegistryType.ASYMMETRIC_BLOCK_CIPHER, null));
}
}
use of org.jcryptool.crypto.flexiprovider.algorithms.ui.wizards.AlgorithmWizard 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