Class DefaultTlsDHGroupVerifier

java.lang.Object
org.bouncycastle.tls.DefaultTlsDHGroupVerifier
All Implemented Interfaces:
TlsDHGroupVerifier

public class DefaultTlsDHGroupVerifier extends Object implements TlsDHGroupVerifier
  • Field Details

    • DEFAULT_MINIMUM_PRIME_BITS

      public static final int DEFAULT_MINIMUM_PRIME_BITS
      See Also:
    • groups

      protected Vector groups
    • minimumPrimeBits

      protected int minimumPrimeBits
  • Constructor Details

    • DefaultTlsDHGroupVerifier

      public DefaultTlsDHGroupVerifier()
      Accept named groups and various standard DH groups with 'P' at least DEFAULT_MINIMUM_PRIME_BITS bits.
    • 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(Vector groups, int minimumPrimeBits)
      Accept named groups and a custom set of group parameters, subject to a minimum bitlength for 'P'.
      Parameters:
      groups - a Vector of acceptable DHGroups.
  • Method Details

    • accept

      public boolean accept(DHGroup dhGroup)
      Description copied from interface: TlsDHGroupVerifier
      Check whether the given DH group is acceptable for use.
      Specified by:
      accept in interface TlsDHGroupVerifier
      Parameters:
      dhGroup - the DHGroup to check
      Returns:
      true if (and only if) the specified group is acceptable
    • getMinimumPrimeBits

      public int getMinimumPrimeBits()
    • areGroupsEqual

      protected boolean areGroupsEqual(DHGroup a, DHGroup b)
    • areParametersEqual

      protected boolean areParametersEqual(BigInteger a, BigInteger b)
    • checkGroup

      protected boolean checkGroup(DHGroup dhGroup)
    • checkMinimumPrimeBits

      protected boolean checkMinimumPrimeBits(DHGroup dhGroup)