public class

DHGexParameters

extends Object
java.lang.Object
   ↳ com.trilead.ssh2.DHGexParameters

Class Overview

A DHGexParameters object can be used to specify parameters for the diffie-hellman group exchange.

Depending on which constructor is used, either the use of a SSH_MSG_KEX_DH_GEX_REQUEST or SSH_MSG_KEX_DH_GEX_REQUEST_OLD can be forced.

Summary

Constants
int MAX_ALLOWED
int MIN_ALLOWED
Fields
private final int max_group_len
private final int min_group_len
private final int pref_group_len
Public Constructors
DHGexParameters()
DHGexParameters(int pref_group_len)
This constructor can be used to force the sending of a SSH_MSG_KEX_DH_GEX_REQUEST_OLD request.
DHGexParameters(int min_group_len, int pref_group_len, int max_group_len)
This constructor can be used to force the sending of a SSH_MSG_KEX_DH_GEX_REQUEST request.
Public Methods
int getMax_group_len()
Get the maximum group length.
int getMin_group_len()
Get the minimum group length.
int getPref_group_len()
Get the preferred group length.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

private static final int MAX_ALLOWED

Constant Value: 8192 (0x00002000)

private static final int MIN_ALLOWED

Constant Value: 1024 (0x00000400)

Fields

private final int max_group_len

private final int min_group_len

private final int pref_group_len

Public Constructors

public DHGexParameters ()

Same as calling DHGexParameters(1024, 1024, 4096). This is also the default used by the Connection class.

public DHGexParameters (int pref_group_len)

This constructor can be used to force the sending of a SSH_MSG_KEX_DH_GEX_REQUEST_OLD request. Internally, the minimum and maximum group lengths will be set to zero.

Parameters
pref_group_len Has to be >= 1024 and <= 8192

public DHGexParameters (int min_group_len, int pref_group_len, int max_group_len)

This constructor can be used to force the sending of a SSH_MSG_KEX_DH_GEX_REQUEST request.

Note: older OpenSSH servers don't understand this request, in which case you should use the DHGexParameters(int) constructor.

All values have to be >= 1024 and <= 8192. Furthermore, min_group_len <= pref_group_len <= max_group_len.

Parameters
min_group_len
pref_group_len
max_group_len

Public Methods

public int getMax_group_len ()

Get the maximum group length.

Returns
  • the maximum group length, may be zero if SSH_MSG_KEX_DH_GEX_REQUEST_OLD should be requested

public int getMin_group_len ()

Get the minimum group length.

Returns
  • minimum group length, may be zero if SSH_MSG_KEX_DH_GEX_REQUEST_OLD should be requested

public int getPref_group_len ()

Get the preferred group length.

Returns
  • the preferred group length