예제 #1
0
        /// <exception cref="NSch.JSchException"></exception>
        public virtual void AddIdentity(string name, byte[] prvkey, byte[] pubkey, byte[]
                                        passphrase)
        {
            Identity identity = IdentityFile.NewInstance(name, prvkey, pubkey, this);

            AddIdentity(identity, passphrase);
        }
예제 #2
0
 public override bool Equals(object o)
 {
     if (!(o is NSch.IdentityFile))
     {
         return(base.Equals(o));
     }
     NSch.IdentityFile foo = (NSch.IdentityFile)o;
     return(GetName().Equals(foo.GetName()));
 }
예제 #3
0
 public virtual bool Add(byte[] identity)
 {
     lock (this)
     {
         try
         {
             Identity _identity = IdentityFile.NewInstance("from remote:", identity, null, jsch
                                                           );
             identities.Add(_identity);
             return(true);
         }
         catch (JSchException)
         {
             return(false);
         }
     }
 }
예제 #4
0
        /// <exception cref="NSch.JSchException"></exception>
        public virtual void AddIdentity(string prvkey, byte[] passphrase)
        {
            Identity identity = IdentityFile.NewInstance(prvkey, null, this);

            AddIdentity(identity, passphrase);
        }