/** @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; identityRepository.remove(identity.getPublicKeyBlob()); break; } }
/** * Lists names of identities included in the identityRepository. * * @return names of identities * @throws JSchException if identityReposory has problems. */ public Vector getIdentityNames() throws JSchException { Vector foo = new Vector(); Vector identities = identityRepository.getIdentities(); for (int i = 0; i < identities.size(); i++) { Identity identity = (Identity) (identities.elementAt(i)); foo.addElement(identity.getName()); } return foo; }
/** * Removes all identities from identityRepository. * * @throws JSchException if identityReposory has problems. */ public void removeAllIdentity() throws JSchException { identityRepository.removeAll(); }
/** * 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()); }