Class BCStrictStyle

All Implemented Interfaces:
X500NameStyle

public class BCStrictStyle extends BCStyle
Variation of BCStyle that insists on strict ordering for equality and hashCode comparisons
  • Field Details

  • Constructor Details

    • BCStrictStyle

      public BCStrictStyle()
  • Method Details

    • areEqual

      public boolean areEqual(X500Name name1, X500Name name2)
      Description copied from class: AbstractX500NameStyle
      Two names are equal when they carry the same multiset of RDNs, each RDN compared by AbstractX500NameStyle.rdnAreEqual(RDN, RDN). The RDNs are first compared position by position, in the order they appear or, when the first attribute types differ, in reverse (the usual two encodings of one name); only when that fails are the two multisets compared, by sorting the canonical form of every RDN once, so a name reached from untrusted data costs n log n in its number of RDNs rather than the n squared of a pairwise search. A subclass that overrides rdnAreEqual is consulted on the positional pass; the multiset pass compares the canonical forms of IETFUtils.canonicalString(ASN1Encodable).
      Specified by:
      areEqual in interface X500NameStyle
      Overrides:
      areEqual in class AbstractX500NameStyle
      Parameters:
      name1 - first name for comparison.
      name2 - second name for comparison.
      Returns:
      true if name1 = name 2, false otherwise.