use of org.jcryptool.crypto.flexiprovider.descriptors.meta.interfaces.IMetaKeyGenerator in project core by jcryptool.
the class BlockCipherWizard method getDummyKey.
protected SecretKey getDummyKey() {
try {
// $NON-NLS-1$
LogUtil.logInfo("generating dummy key");
IMetaKeyGenerator secGen = AlgorithmsXMLManager.getInstance().getSecretKeyGenerator(algorithm.getName());
SecretKeyGenerator gen = (SecretKeyGenerator) Class.forName(secGen.getClassName()).newInstance();
gen.init(algorithm.getDefaultBlockLength());
dummyKey = gen.generateKey();
// $NON-NLS-1$
LogUtil.logInfo("Key generated: " + dummyKey.getAlgorithm());
return dummyKey;
} catch (ClassNotFoundException e) {
LogUtil.logError(FlexiProviderAlgorithmsPlugin.PLUGIN_ID, "ClassNotFoundException while creating the dummy key", e, false);
} catch (InstantiationException e) {
LogUtil.logError(FlexiProviderAlgorithmsPlugin.PLUGIN_ID, "InstantiationException while creating the dummy key", e, false);
} catch (IllegalAccessException e) {
LogUtil.logError(FlexiProviderAlgorithmsPlugin.PLUGIN_ID, "IllegalAccessException while creating the dummy key", e, false);
}
return null;
}
Aggregations