Class BCStrictStyle
java.lang.Object
org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
org.bouncycastle.asn1.x500.style.BCStyle
org.bouncycastle.asn1.x500.style.BCStrictStyle
- All Implemented Interfaces:
X500NameStyle
Variation of BCStyle that insists on strict ordering for equality
and hashCode comparisons
-
Field Summary
FieldsFields inherited from class 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo names are equal when they carry the same multiset of RDNs, each RDN compared byAbstractX500NameStyle.rdnAreEqual(RDN, RDN).Methods inherited from class BCStyle
attrNameToOID, encodeStringValue, fromString, oidToAttrNames, oidToDisplayName, toStringMethods inherited from class AbstractX500NameStyle
calculateHashCode, copyHashTable, rdnAreEqual, stringToValue
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
BCStrictStyle
public BCStrictStyle()
-
-
Method Details
-
areEqual
Description copied from class:AbstractX500NameStyleTwo names are equal when they carry the same multiset of RDNs, each RDN compared byAbstractX500NameStyle.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 ofIETFUtils.canonicalString(ASN1Encodable).- Specified by:
areEqualin interfaceX500NameStyle- Overrides:
areEqualin classAbstractX500NameStyle- Parameters:
name1- first name for comparison.name2- second name for comparison.- Returns:
- true if name1 = name 2, false otherwise.
-