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(){ Vector v = new Vector(); int len = identities.size(); if(len == 0) return; for(int i=0; i<len; i++){ Identity foo = (Identity)identities.elementAt(i); byte[] foo_blob = foo.getPublicKeyBlob(); if(foo_blob == null) continue; for(int j=i+1; j<len; j++){ Identity bar = (Identity)identities.elementAt(j); byte[] bar_blob = bar.getPublicKeyBlob(); if(bar_blob == null) continue; if(Util.array_equals(foo_blob, bar_blob) && foo.isEncrypted() == bar.isEncrypted()){ v.addElement(foo_blob); break; } } } for(int i=0; i<v.size(); i++){ remove((byte[])v.elementAt(i)); } } }
private void removeDupulicates(){ Vector v = new Vector(); int len = identities.size(); if(len == 0) return; for(int i=0; i<len; i++){ Identity foo = (Identity)identities.elementAt(i); byte[] foo_blob = foo.getPublicKeyBlob(); if(foo_blob == null) continue; for(int j=i+1; j<len; j++){ Identity bar = (Identity)identities.elementAt(j); byte[] bar_blob = bar.getPublicKeyBlob(); if(bar_blob == null) continue; if(Util.array_equals(foo_blob, bar_blob) && foo.isEncrypted() == bar.isEncrypted()){ v.addElement(foo_blob); break; } } } for(int i=0; i<v.size(); i++){ remove((byte[])v.elementAt(i)); } } }
private void removeDupulicates(){ Vector v = new Vector(); int len = identities.size(); if(len == 0) return; for(int i=0; i<len; i++){ Identity foo = (Identity)identities.elementAt(i); byte[] foo_blob = foo.getPublicKeyBlob(); if(foo_blob == null) continue; for(int j=i+1; j<len; j++){ Identity bar = (Identity)identities.elementAt(j); byte[] bar_blob = bar.getPublicKeyBlob(); if(bar_blob == null) continue; if(Util.array_equals(foo_blob, bar_blob) && foo.isEncrypted() == bar.isEncrypted()){ v.addElement(foo_blob); break; } } } for(int i=0; i<v.size(); i++){ remove((byte[])v.elementAt(i)); } } }
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); } } }
void add(Identity identity) { if (!keep_in_cache && !identity.isEncrypted() && (identity instanceof IdentityFile)) { try { ir.add(((IdentityFile) identity).getKeyPair().forSSHAgent()); } catch (JSchException e) { } } else cache.add(identity); }
void add(Identity identity) { if(!keep_in_cache && !identity.isEncrypted() && (identity instanceof IdentityFile)) { try { ir.add(((IdentityFile)identity).getKeyPair().forSSHAgent()); } catch(JSchException e){ // an exception will not be thrown. } } else cache.addElement(identity); } void check() {
void add(Identity identity) { if(!keep_in_cache && !identity.isEncrypted() && (identity instanceof IdentityFile)) { try { ir.add(((IdentityFile)identity).getKeyPair().forSSHAgent()); } catch(JSchException e){ // an exception will not be thrown. } } else cache.addElement(identity); } void check() {
void add(Identity identity) { if(!keep_in_cache && !identity.isEncrypted() && (identity instanceof IdentityFile)) { try { ir.add(((IdentityFile)identity).getKeyPair().forSSHAgent()); } catch(JSchException e){ // an exception will not be thrown. } } else cache.addElement(identity); } void check() {
if (!identity.isEncrypted()) { throw new JSchException("unexpected passphrase");
} else if (identity instanceof IdentityFile && !identity.isEncrypted()) { identityRepository.add(((IdentityFile) identity).getKeyPair().forSSHAgent()); } else {
((LocalIdentityRepository)identityRepository).add(identity); else if(identity instanceof IdentityFile && !identity.isEncrypted()) { identityRepository.add(((IdentityFile)identity).getKeyPair().forSSHAgent());
((LocalIdentityRepository)identityRepository).add(identity); else if(identity instanceof IdentityFile && !identity.isEncrypted()) { identityRepository.add(((IdentityFile)identity).getKeyPair().forSSHAgent());
((LocalIdentityRepository)identityRepository).add(identity); else if(identity instanceof IdentityFile && !identity.isEncrypted()) { identityRepository.add(((IdentityFile)identity).getKeyPair().forSSHAgent());
continue; if(_identity.isEncrypted()){ if(userinfo==null) continue; while(_identity.isEncrypted()){ if(!userinfo.promptPassphrase("Passphrase for "+_identity.getName())){ break; if(!_identity.isEncrypted()){ identity=_identity; break;
continue; if(_identity.isEncrypted()){ if(userinfo==null) continue; while(_identity.isEncrypted()){ if(!userinfo.promptPassphrase("Passphrase for "+_identity.getName())){ break; if(!_identity.isEncrypted()){ identity=_identity; break;
continue; if (_identity.isEncrypted()) { if (userinfo == null) continue; while (_identity.isEncrypted()) { if (!userinfo.promptPassphrase("Passphrase for " + _identity.getName())) { break; if (!_identity.isEncrypted()) { identity = _identity; break;