Package org.bouncycastle.asn1.x500.style
Class AbstractX500NameStyle
java.lang.Object
org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
- All Implemented Interfaces:
X500NameStyle
- Direct Known Subclasses:
BCStyle
,RFC4519Style
This class provides some default behavior and common implementation for a
X500NameStyle. It should be easily extendable to support implementing the
desired X500NameStyle.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return true if the two names are equal.int
calculateHashCode
(X500Name name) Calculate a hashCode for the passed in name.static Hashtable
copyHashTable
(Hashtable paramsMap) Tool function to shallow copy a Hashtable.protected ASN1Encodable
encodeStringValue
(ASN1ObjectIdentifier oid, String value) Encoded every value into a UTF8String.protected boolean
rdnAreEqual
(RDN rdn1, RDN rdn2) stringToValue
(ASN1ObjectIdentifier oid, String value) For all string values starting with '#' is assumed, that these are already valid ASN.1 objects encoded in hex.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bouncycastle.asn1.x500.X500NameStyle
attrNameToOID, fromString, oidToAttrNames, oidToDisplayName, toString
-
Constructor Details
-
AbstractX500NameStyle
public AbstractX500NameStyle()
-
-
Method Details
-
copyHashTable
Tool function to shallow copy a Hashtable.- Parameters:
paramsMap
- table to copy- Returns:
- the copy of the table
-
calculateHashCode
Description copied from interface:X500NameStyle
Calculate a hashCode for the passed in name.- Specified by:
calculateHashCode
in interfaceX500NameStyle
- Parameters:
name
- the name the hashCode is required for.- Returns:
- the calculated hashCode.
-
stringToValue
For all string values starting with '#' is assumed, that these are already valid ASN.1 objects encoded in hex.All other string values are send to
Subclasses should overwriteencodeStringValue(ASN1ObjectIdentifier, String)
.encodeStringValue(ASN1ObjectIdentifier, String)
to change the encoding of specific types.- Specified by:
stringToValue
in interfaceX500NameStyle
- Parameters:
oid
- the DN name of the value.value
- the String representation of the value.- Returns:
- the ASN.1 equivalent for the value.
-
encodeStringValue
Encoded every value into a UTF8String.Subclasses should overwrite this method to change the encoding of specific types.
- Parameters:
oid
- the DN oid of the valuevalue
- the String representation of the value- Returns:
- a the value encoded into a ASN.1 object. Never returns
null
.
-
areEqual
Description copied from interface:X500NameStyle
Return true if the two names are equal.- Specified by:
areEqual
in interfaceX500NameStyle
- Parameters:
name1
- first name for comparison.name2
- second name for comparison.- Returns:
- true if name1 = name 2, false otherwise.
-
rdnAreEqual
-