Class DNComparator
java.lang.Object
eu.emi.security.authn.x509.helpers.DNComparator
Helpers for checking text representations of DNs for equality.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getHashCode
(String dn) private static org.bouncycastle.asn1.x500.AttributeTypeAndValue
normalizeAVA
(org.bouncycastle.asn1.x500.AttributeTypeAndValue orig) static String
preNormalize
(String dn) Returns a form of the original DN which will be properly parsed by JDKX500Principal
class by replacing attribute names unknown by theX500Principal
with OIDs.private static String
Uppers the case of the arg, then lowers it, using non-locale specific algorithm.
-
Constructor Details
-
DNComparator
public DNComparator()
-
-
Method Details
-
preNormalize
Returns a form of the original DN which will be properly parsed by JDKX500Principal
class by replacing attribute names unknown by theX500Principal
with OIDs. What is more all DC and EMAIL values are converted to lower case.- Parameters:
dn
- in RFC 2253 form.- Returns:
- dn in RFC 2253 form, reformatted.
-
getHashCode
- Parameters:
dn
- source dn- Returns:
- hashcode useful as a return value of the hshCode() method,
when equals is overriden to use
X500NameUtils
equals method.
-
upLowCase
Uppers the case of the arg, then lowers it, using non-locale specific algorithm.- Parameters:
src
- source string.- Returns:
- modified string.
-
normalizeAVA
private static org.bouncycastle.asn1.x500.AttributeTypeAndValue normalizeAVA(org.bouncycastle.asn1.x500.AttributeTypeAndValue orig)
-