Package com.trilead.ssh2.packets

Examples of com.trilead.ssh2.packets.TypesReader.readString()


        {
          TypesReader tr = new TypesReader(msg, 0, msglen);
          tr.readByte();
          tr.readBoolean();
          StringBuffer debugMessageBuffer = new StringBuffer();
          debugMessageBuffer.append(tr.readString("UTF-8"));

          for (int i = 0; i < debugMessageBuffer.length(); i++)
          {
            char c = debugMessageBuffer.charAt(i);
View Full Code Here


      {
        TypesReader tr = new TypesReader(msg, 0, msglen);
        tr.readByte();
        int reason_code = tr.readUINT32();
        StringBuffer reasonBuffer = new StringBuffer();
        reasonBuffer.append(tr.readString("UTF-8"));

        /*
         * Do not get fooled by servers that send abnormal long error
         * messages
         */
 
View Full Code Here

  public static RSAPublicKey decodeSSHRSAPublicKey(byte[] key) throws IOException
  {
    TypesReader tr = new TypesReader(key);

    String key_format = tr.readString();

    if (key_format.equals("ssh-rsa") == false)
      throw new IllegalArgumentException("This is not a ssh-rsa public key");

    BigInteger e = tr.readMPINT();
View Full Code Here

  public static RSASignature decodeSSHRSASignature(byte[] sig) throws IOException
  {
    TypesReader tr = new TypesReader(sig);

    String sig_format = tr.readString();

    if (sig_format.equals("ssh-rsa") == false)
      throw new IOException("Peer sent wrong signature format");

    /* S is NOT an MPINT. "The value for 'rsa_signature_blob' is encoded as a string
View Full Code Here

  public static DSAPublicKey decodeSSHDSAPublicKey(byte[] key) throws IOException
  {
    TypesReader tr = new TypesReader(key);

    String key_format = tr.readString();

    if (key_format.equals("ssh-dss") == false)
      throw new IllegalArgumentException("This is not a ssh-dss public key!");

    BigInteger p = tr.readMPINT();
View Full Code Here

    }
    else
    {
      TypesReader tr = new TypesReader(sig);

      String sig_format = tr.readString();

      if (sig_format.equals("ssh-dss") == false)
        throw new IOException("Peer sent wrong signature format");

      rsArray = tr.readByteString();
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();

    throw new SFTPException(tr.readString(), errorCode);
  }

  private SFTPv3FileAttributes statBoth(String path, int statMethod) throws IOException
  {
    int req_id = generateNextRequestID();
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();

    throw new SFTPException(tr.readString(), errorCode);
  }

  /**
   * Retrieve the file attributes of a file. This method
   * follows symbolic links on the server.
View Full Code Here

      int count = tr.readUINT32();

      if (count != 1)
        throw new IOException("The server sent an invalid SSH_FXP_NAME packet.");

      return tr.readString(charsetName);
    }

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");
View Full Code Here

    if (t != Packet.SSH_FXP_STATUS)
      throw new IOException("The SFTP server sent an unexpected packet type (" + t + ")");

    int errorCode = tr.readUINT32();

    throw new SFTPException(tr.readString(), errorCode);
  }

  private void expectStatusOKMessage(int id) throws IOException
  {
    byte[] resp = receiveMessage(34000);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.