/** * Removes the identity from identityRepository. * * @param identity the indentity to be removed. * * @throws JSchException if <code>identity</code> is invalid. */ public void removeIdentity(Identity identity) throws JSchException{ identityRepository.remove(identity.getPublicKeyBlob()); }
/** * Removes the identity from identityRepository. * * @param identity the indentity to be removed. * * @throws JSchException if <code>identity</code> is invalid. */ public void removeIdentity(Identity identity) throws JSchException{ identityRepository.remove(identity.getPublicKeyBlob()); }
/** * Removes the identity from identityRepository. * * @param identity the indentity to be removed. * @throws JSchException if <code>identity</code> is invalid. */ public void removeIdentity(Identity identity) throws JSchException { identityRepository.remove(identity.getPublicKeyBlob()); }
/** * Removes the identity from identityRepository. * * @param identity the indentity to be removed. * * @throws JSchException if <code>identity</code> is invalid. */ public void removeIdentity(Identity identity) throws JSchException{ identityRepository.remove(identity.getPublicKeyBlob()); }
synchronized void remove(Identity identity) { if(identities.contains(identity)) { identities.removeElement(identity); identity.clear(); } else { remove(identity.getPublicKeyBlob()); } }
public synchronized boolean remove(byte[] blob) { if(blob == null) return false; for(int i=0; i<identities.size(); i++) { Identity _identity = (Identity)(identities.elementAt(i)); byte[] _blob = _identity.getPublicKeyBlob(); if(_blob == null || !Util.array_equals(blob, _blob)) continue; identities.removeElement(_identity); _identity.clear(); return true; } return false; }
public synchronized boolean remove(byte[] blob) { if(blob == null) return false; for(int i=0; i<identities.size(); i++) { Identity _identity = (Identity)(identities.elementAt(i)); byte[] _blob = _identity.getPublicKeyBlob(); if(_blob == null || !Util.array_equals(blob, _blob)) continue; identities.removeElement(_identity); _identity.clear(); return true; } return false; }
synchronized void remove(Identity identity) { if(identities.contains(identity)) { identities.removeElement(identity); identity.clear(); } else { remove(identity.getPublicKeyBlob()); } }
public synchronized boolean remove(byte[] blob) { if(blob == null) return false; for(int i=0; i<identities.size(); i++) { Identity _identity = (Identity)(identities.elementAt(i)); byte[] _blob = _identity.getPublicKeyBlob(); if(_blob == null || !Util.array_equals(blob, _blob)) continue; identities.removeElement(_identity); _identity.clear(); return true; } return false; }
synchronized void remove(Identity identity) { if(identities.contains(identity)) { identities.removeElement(identity); identity.clear(); } else { remove(identity.getPublicKeyBlob()); } }
synchronized void remove(Identity identity) { if (identities.contains(identity)) { identities.remove(identity); identity.clear(); } else { remove(identity.getPublicKeyBlob()); } }
public synchronized boolean remove(byte[] blob) { if (blob == null) return false; for (int i = 0; i < identities.size(); i++) { Identity _identity = identities.get(i); byte[] _blob = _identity.getPublicKeyBlob(); if (_blob == null || !Util.array_equals(blob, _blob)) continue; identities.remove(_identity); _identity.clear(); return true; } return false; }
public synchronized void add(Identity identity) { if(!identities.contains(identity)) { byte[] blob1 = identity.getPublicKeyBlob(); if(blob1 == null) { identities.addElement(identity); return; } for(int i = 0; i<identities.size(); i++){ byte[] blob2 = ((Identity)identities.elementAt(i)).getPublicKeyBlob(); if(blob2 != null && Util.array_equals(blob1, blob2)){ if(!identity.isEncrypted() && ((Identity)identities.elementAt(i)).isEncrypted()){ remove(blob2); } else { return; } } } identities.addElement(identity); } }
public synchronized void add(Identity identity) { if(!identities.contains(identity)) { byte[] blob1 = identity.getPublicKeyBlob(); if(blob1 == null) { identities.addElement(identity); return; } for(int i = 0; i<identities.size(); i++){ byte[] blob2 = ((Identity)identities.elementAt(i)).getPublicKeyBlob(); if(blob2 != null && Util.array_equals(blob1, blob2)){ if(!identity.isEncrypted() && ((Identity)identities.elementAt(i)).isEncrypted()){ remove(blob2); } else { return; } } } identities.addElement(identity); } }
public synchronized void add(Identity identity) { if(!identities.contains(identity)) { byte[] blob1 = identity.getPublicKeyBlob(); if(blob1 == null) { identities.addElement(identity); return; } for(int i = 0; i<identities.size(); i++){ byte[] blob2 = ((Identity)identities.elementAt(i)).getPublicKeyBlob(); if(blob2 != null && Util.array_equals(blob1, blob2)){ if(!identity.isEncrypted() && ((Identity)identities.elementAt(i)).isEncrypted()){ remove(blob2); } else { return; } } } identities.addElement(identity); } }
public synchronized void add(Identity identity) { if (!identities.contains(identity)) { byte[] blob1 = identity.getPublicKeyBlob(); if (blob1 == null) { identities.add(identity); return; } for (Identity identity1 : identities) { byte[] blob2 = identity1.getPublicKeyBlob(); if (blob2 != null && Util.array_equals(blob1, blob2)) { if (!identity.isEncrypted() && identity1.isEncrypted()) { remove(blob2); } else { return; } } } identities.add(identity); } }
private void removeDupulicates() { List<byte[]> v = new ArrayList<>(); int len = identities.size(); if (len == 0) return; for (int i = 0; i < len; i++) { Identity foo = identities.get(i); byte[] foo_blob = foo.getPublicKeyBlob(); if (foo_blob == null) continue; for (int j = i + 1; j < len; j++) { Identity bar = identities.get(j); byte[] bar_blob = bar.getPublicKeyBlob(); if (bar_blob == null) continue; if (Util.array_equals(foo_blob, bar_blob) && foo.isEncrypted() == bar.isEncrypted()) { v.add(foo_blob); break; } } } for (byte[] aV : v) { remove(aV); } } }
/** * @deprecated use #removeIdentity(Identity identity) */ public void removeIdentity(String name) throws JSchException{ Vector identities = identityRepository.getIdentities(); for(int i=0; i<identities.size(); i++){ Identity identity=(Identity)(identities.elementAt(i)); if(!identity.getName().equals(name)) continue; if(identityRepository instanceof LocalIdentityRepository){ ((LocalIdentityRepository)identityRepository).remove(identity); } else identityRepository.remove(identity.getPublicKeyBlob()); } }
/** * @deprecated use #removeIdentity(Identity identity) */ public void removeIdentity(String name) throws JSchException{ Vector identities = identityRepository.getIdentities(); for(int i=0; i<identities.size(); i++){ Identity identity=(Identity)(identities.elementAt(i)); if(!identity.getName().equals(name)) continue; if(identityRepository instanceof LocalIdentityRepository){ ((LocalIdentityRepository)identityRepository).remove(identity); } else identityRepository.remove(identity.getPublicKeyBlob()); } }
/** * Removes an identity by name. * (The name is the result of the {@link Identity#getName getName} * method of the Identity object.) * * This identity will not be used for future connections anymore. * (We also {@link Identity#clear clear} the identity, causing it * to forget its passphrase.) * @param name the name of the identity to remove. * @deprecated use #removeIdentity(Identity identity) */ public void removeIdentity(String name) throws JSchException{ Vector identities = identityRepository.getIdentities(); for(int i=0; i<identities.size(); i++){ Identity identity=(Identity)(identities.elementAt(i)); if(!identity.getName().equals(name)) continue; if(identityRepository instanceof LocalIdentityRepository){ ((LocalIdentityRepository)identityRepository).remove(identity); } else identityRepository.remove(identity.getPublicKeyBlob()); } }