Exemple #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);
        }
Exemple #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()));
 }
 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);
         }
     }
 }
Exemple #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);
        }