예제 #1
0
 /** @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;
   }
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 /**
  * Removes all identities from identityRepository.
  *
  * @throws JSchException if identityReposory has problems.
  */
 public void removeAllIdentity() throws JSchException {
   identityRepository.removeAll();
 }
예제 #4
0
 /**
  * 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());
 }