Package org.bouncycastle.tls
Class DefaultTlsDHGroupVerifier
- java.lang.Object
-
- org.bouncycastle.tls.DefaultTlsDHGroupVerifier
-
- All Implemented Interfaces:
TlsDHGroupVerifier
public class DefaultTlsDHGroupVerifier extends java.lang.Object implements TlsDHGroupVerifier
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MINIMUM_PRIME_BITSprotected java.util.Vectorgroupsprotected intminimumPrimeBits
-
Constructor Summary
Constructors Constructor Description DefaultTlsDHGroupVerifier()Accept named groups and various standard DH groups with 'P' at leastDEFAULT_MINIMUM_PRIME_BITSbits.DefaultTlsDHGroupVerifier(int minimumPrimeBits)Accept named groups and various standard DH groups with 'P' at least the specified number of bits.DefaultTlsDHGroupVerifier(java.util.Vector groups, int minimumPrimeBits)Accept named groups and a custom set of group parameters, subject to a minimum bitlength for 'P'.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(DHGroup dhGroup)Check whether the given DH group is acceptable for use.protected booleanareGroupsEqual(DHGroup a, DHGroup b)protected booleanareParametersEqual(java.math.BigInteger a, java.math.BigInteger b)protected booleancheckGroup(DHGroup dhGroup)protected booleancheckMinimumPrimeBits(DHGroup dhGroup)intgetMinimumPrimeBits()
-
-
-
Field Detail
-
DEFAULT_MINIMUM_PRIME_BITS
public static final int DEFAULT_MINIMUM_PRIME_BITS
- See Also:
- Constant Field Values
-
groups
protected java.util.Vector groups
-
minimumPrimeBits
protected int minimumPrimeBits
-
-
Constructor Detail
-
DefaultTlsDHGroupVerifier
public DefaultTlsDHGroupVerifier()
Accept named groups and various standard DH groups with 'P' at leastDEFAULT_MINIMUM_PRIME_BITSbits.
-
DefaultTlsDHGroupVerifier
public DefaultTlsDHGroupVerifier(int minimumPrimeBits)
Accept named groups and various standard DH groups with 'P' at least the specified number of bits.
-
DefaultTlsDHGroupVerifier
public DefaultTlsDHGroupVerifier(java.util.Vector groups, int minimumPrimeBits)Accept named groups and a custom set of group parameters, subject to a minimum bitlength for 'P'.- Parameters:
groups- aVectorof acceptableDHGroups.
-
-
Method Detail
-
accept
public boolean accept(DHGroup dhGroup)
Description copied from interface:TlsDHGroupVerifierCheck whether the given DH group is acceptable for use.- Specified by:
acceptin interfaceTlsDHGroupVerifier- Parameters:
dhGroup- theDHGroupto check- Returns:
- true if (and only if) the specified group is acceptable
-
getMinimumPrimeBits
public int getMinimumPrimeBits()
-
areParametersEqual
protected boolean areParametersEqual(java.math.BigInteger a, java.math.BigInteger b)
-
checkGroup
protected boolean checkGroup(DHGroup dhGroup)
-
checkMinimumPrimeBits
protected boolean checkMinimumPrimeBits(DHGroup dhGroup)
-
-