示例#1
0
        /// <summary>
        /// Create new instance from SSH_FXP_STATUS packet data.
        /// </summary>
        /// <param name="dataReader">data reader</param>
        /// <returns>new instance</returns>
        internal static SFTPClientErrorException Create(SSHDataReader dataReader)
        {
            uint   id          = (uint)dataReader.ReadInt32();
            uint   code        = (uint)dataReader.ReadInt32();
            string message     = dataReader.ReadUTF8String();
            string languageTag = dataReader.ReadString();

            return(new SFTPClientErrorException(id, code, message, languageTag));
        }
示例#2
0
        internal SSHServerInfo(SSHDataReader reader)
        {
            anti_spoofing_cookie = reader.Read(8);             //first 8 bytes are cookie

            server_key_bits            = reader.ReadInt32();
            server_key_public_exponent = reader.ReadMPInt();
            server_key_public_modulus  = reader.ReadMPInt();
            host_key_bits            = reader.ReadInt32();
            host_key_public_exponent = reader.ReadMPInt();
            host_key_public_modulus  = reader.ReadMPInt();
        }
示例#3
0
        /// <summary>
        /// Create new instance from SSH_FXP_STATUS packet data.
        /// </summary>
        /// <param name="dataReader">data reader</param>
        /// <returns>new instance</returns>
        internal static SFTPClientErrorException Create(SSHDataReader dataReader)
        {
            uint id   = (uint)dataReader.ReadInt32();
            uint code = (uint)dataReader.ReadInt32();

            byte[] messageData = dataReader.ReadString();
            string message     = Encoding.UTF8.GetString(messageData);

            byte[] languageTagData = dataReader.ReadString();
            string languageTag     = Encoding.ASCII.GetString(languageTagData);

            return(new SFTPClientErrorException(id, code, message, languageTag));
        }