Package org.apache.sshd.common.kex
Class DHGroupData
java.lang.Object
org.apache.sshd.common.kex.DHGroupData
Simple class holding the data for DH group key exchanges.
- Author:
- Apache MINA SSHD Project
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getG()
static byte[]
static byte[]
getP1()
static byte[]
getP14()
static byte[]
getP15()
static byte[]
getP16()
static byte[]
getP17()
static byte[]
getP18()
static byte[]
Parses the string assumed to contain a HEX-encoded Oakely prime value in big endian formatstatic byte[]
Reads a HEX encoded prime value from a possibly multi-line input as follows:static byte[]
readOakleyGroupPrimeValue
(InputStream stream) static byte[]
static byte[]
Reads a HEX-encoded Oakley prime value from an internal resource filestatic byte[]
readOakleyGroupPrimeValue
(Stream<String> lines)
-
Method Details
-
getG
public static byte[] getG() -
getP1
public static byte[] getP1() -
getP14
public static byte[] getP14() -
getP15
public static byte[] getP15() -
getP16
public static byte[] getP16() -
getP17
public static byte[] getP17() -
getP18
public static byte[] getP18() -
getOakleyGroupPrimeValue
- Parameters:
name
- The name of the resource file containing the prime value data- Returns:
- The prime value bytes suitable for building a
BigInteger
-
readOakleyGroupPrimeValue
Reads a HEX-encoded Oakley prime value from an internal resource file- Parameters:
name
- The name of the resource file containing the prime value data. Seeorg.apache.sshd.common.kex
package for available primes- Returns:
- The prime value bytes suitable for building a
BigInteger
- Throws:
IOError
- If failed to access/read the required resource- See Also:
-
readOakleyGroupPrimeValue
- Throws:
IOException
-
readOakleyGroupPrimeValue
- Throws:
IOException
-
readOakleyGroupPrimeValue
Reads a HEX encoded prime value from a possibly multi-line input as follows:
- Lines are trimmed and all whitespaces removed.
- Empty lines (after trimming) are ignored.
- Lines beginning with "#" are ignored (assumed to be comments).
- Remaining lines are appended to one big string assumed to contain the HEX-encoded value
- Parameters:
br
- TheBufferedReader
to read the data from- Returns:
- The prime value bytes suitable for building a
BigInteger
- Throws:
IOException
- If invalid data or no encoded value found- See Also:
-
readOakleyGroupPrimeValue
- Throws:
NumberFormatException
-
parseOakleyGroupPrimeValue
Parses the string assumed to contain a HEX-encoded Oakely prime value in big endian format- Parameters:
str
- The HEX-encoded string to decode - ignored ifnull
/empty- Returns:
- The prime value bytes suitable for building a
BigInteger
or empty array if no input - Throws:
NumberFormatException
- if malformed encoded value
-