use of org.jcryptool.crypto.keystore.ui.views.interfaces.IKeyStoreListener in project core by jcryptool.
the class KeyPairContainerNode method addKeyPair.
public void addKeyPair(IKeyStoreAlias privateKey, IKeyStoreAlias publicKey) {
if (privateKey != null && publicKey != null) {
KeyPairNode child = new KeyPairNode(privateKey, publicKey);
setAppropriateNameForNode(child);
nodes.put(privateKey.getHashValue(), child);
addChild(child);
} else if (privateKey != null) {
if (nodes.containsKey(privateKey.getHashValue())) {
nodes.get(privateKey.getHashValue()).addPrivateKey(privateKey);
} else {
KeyPairNode child = new KeyPairNode(privateKey, null);
setAppropriateNameForNode(child);
nodes.put(privateKey.getHashValue(), child);
addChild(child);
}
} else if (publicKey != null) {
if (nodes.containsKey(publicKey.getHashValue())) {
nodes.get(publicKey.getHashValue()).addPublicKey(publicKey);
} else {
KeyPairNode child = new KeyPairNode(null, publicKey);
setAppropriateNameForNode(child);
nodes.put(publicKey.getHashValue(), child);
addChild(child);
}
}
Iterator<IKeyStoreListener> it = ContactManager.getInstance().getKeyStoreListeners();
while (it.hasNext()) {
it.next().fireKeyStoreModified(this);
}
}
Aggregations