Bouncy Castle Cryptography Library 1.87

org.bouncycastle.asn1.x500.style
Class BCStrictStyle

java.lang.Object
  extended byorg.bouncycastle.asn1.x500.style.AbstractX500NameStyle
      extended byorg.bouncycastle.asn1.x500.style.BCStyle
          extended byorg.bouncycastle.asn1.x500.style.BCStrictStyle
All Implemented Interfaces:
X500NameStyle

public class BCStrictStyle
extends BCStyle

Variation of BCStyle that insists on strict ordering for equality and hashCode comparisons


Field Summary
static X500NameStyle INSTANCE
           
 
Fields inherited from class org.bouncycastle.asn1.x500.style.BCStyle
BUSINESS_CATEGORY, C, CN, COUNTRY_OF_CITIZENSHIP, COUNTRY_OF_RESIDENCE, DATE_OF_BIRTH, DC, defaultLookUp, defaultSymbols, DESCRIPTION, DMD_NAME, DN_QUALIFIER, E, EmailAddress, GENDER, GENERATION, GIVENNAME, INITIALS, JURISDICTION_C, JURISDICTION_L, JURISDICTION_ST, L, NAME, NAME_AT_BIRTH, O, ORGANIZATION_IDENTIFIER, OU, PLACE_OF_BIRTH, POSTAL_ADDRESS, POSTAL_CODE, PSEUDONYM, ROLE, SERIALNUMBER, SN, ST, STREET, SURNAME, T, TELEPHONE_NUMBER, UID, UNIQUE_IDENTIFIER, UnstructuredAddress, UnstructuredName
 
Constructor Summary
BCStrictStyle()
           
 
Method Summary
 boolean areEqual(X500Name name1, X500Name name2)
          Two names are equal when they carry the same multiset of RDNs, each RDN compared by AbstractX500NameStyle.rdnAreEqual(RDN, RDN).
 
Methods inherited from class org.bouncycastle.asn1.x500.style.BCStyle
attrNameToOID, encodeStringValue, fromString, oidToAttrNames, oidToDisplayName, toString
 
Methods inherited from class org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
calculateHashCode, copyHashTable, rdnAreEqual, stringToValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final X500NameStyle INSTANCE
Constructor Detail

BCStrictStyle

public BCStrictStyle()
Method Detail

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

Bouncy Castle Cryptography Library 1.87