use of org.jcryptool.crypto.keystore.ui.views.nodes.keys.AbstractKeyNode in project core by jcryptool.
the class SecretKeyContainerNode method remove.
public void remove(IKeyStoreAlias alias) {
AbstractKeyNode child = new SecretKeyNode(alias);
// $NON-NLS-1$
LogUtil.logInfo("nodes.length a priori: " + nodes.size());
nodes.remove(child);
// $NON-NLS-1$
LogUtil.logInfo("nodes.length a posterior: " + nodes.size());
removeChild(child);
Iterator<IKeyStoreListener> it = ContactManager.getInstance().getKeyStoreListeners();
while (it.hasNext()) {
it.next().fireKeyStoreModified(this);
}
}
use of org.jcryptool.crypto.keystore.ui.views.nodes.keys.AbstractKeyNode in project core by jcryptool.
the class AbstractKeyNodeContentProvider method getKey.
/**
* Tries to retrieve the key from keystore using the default password. If the operation succeeds, the default
* password will be updated, if it fails, the user have to enter a password into a prompt window.
*/
protected Key getKey(Object inputElement) {
AbstractKeyNode abstractKeyNode = (AbstractKeyNode) inputElement;
IKeyStoreAlias alias = abstractKeyNode.getAlias();
try {
return KeyStoreManager.getInstance().getKey(alias, KeyStoreManager.KEY_PASSWORD);
} catch (UnrecoverableEntryException ex) {
LogUtil.logError(KeyStorePlugin.PLUGIN_ID, "The entered password was not correct.", ex, true);
} catch (java.security.NoSuchAlgorithmException ex) {
LogUtil.logError(KeyStorePlugin.PLUGIN_ID, "The requested algorithm is not supported.", ex, true);
}
return null;
}
Aggregations