Top Description Constructors Methods
org.bouncycastle.asn1.x500.style

public abstract Class AbstractX500NameStyle

extends Object
implements X500NameStyle
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.x500.X500NameStyle
Known Direct Subclasses
org.bouncycastle.asn1.x500.style.BCStyle, org.bouncycastle.asn1.x500.style.RFC4519Style
Imports
java.io.IOException, java.util.Enumeration, .Hashtable, org.bouncycastle.asn1.ASN1Encodable, .ASN1ObjectIdentifier, .ASN1ParsingException, .DERUTF8String, org.bouncycastle.asn1.x500.AttributeTypeAndValue, .RDN, .X500Name, .X500NameStyle

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
areEqual(X500Name
first name for comparison.
name1
,
X500Name
second name for comparison.
name2
)

Implements org.bouncycastle.asn1.x500.X500NameStyle.areEqual.

Return true if the two names are equal.
private int
public int
calculateHashCode(X500Name
the name the hashCode is required for.
name
)

Implements org.bouncycastle.asn1.x500.X500NameStyle.calculateHashCode.

Calculate a hashCode for the passed in name.
public static Hashtable<K, V>

Returns:

the copy of the table
copyHashTable
(Hashtable<K, V>
table to copy
paramsMap
)

Tool function to shallow copy a Hashtable.

protected ASN1Encodable

Returns:

a the value encoded into a ASN.1 object. Never returns null.
encodeStringValue
(ASN1ObjectIdentifier
the DN oid of the value
oid
,
String
the String representation of the value
value
)

Encoded every value into a UTF8String.

private boolean
foundMatch(boolean reverse, RDN rdn, RDN[] possRDNs)

protected boolean
rdnAreEqual(RDN rdn1, RDN rdn2)

public ASN1Encodable
stringToValue(ASN1ObjectIdentifier
the DN name of the value.
oid
,
String
the String representation of the value.
value
)

Implements org.bouncycastle.asn1.x500.X500NameStyle.stringToValue.

For all string values starting with '#' is assumed, that these are already valid ASN.1 objects encoded in hex.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AbstractX500NameStyleback to summary
public AbstractX500NameStyle()

Method Detail

areEqualback to summary
public boolean areEqual(X500Name name1, X500Name name2)

Implements org.bouncycastle.asn1.x500.X500NameStyle.areEqual.

Doc from org.bouncycastle.asn1.x500.X500NameStyle.areEqual.

Return true if the two names are equal.

Parameters
name1:X500Name

first name for comparison.

name2:X500Name

second name for comparison.

Returns:boolean

true if name1 = name 2, false otherwise.

calcHashCodeback to summary
private int calcHashCode(ASN1Encodable enc)
calculateHashCodeback to summary
public int calculateHashCode(X500Name name)

Implements org.bouncycastle.asn1.x500.X500NameStyle.calculateHashCode.

Doc from org.bouncycastle.asn1.x500.X500NameStyle.calculateHashCode.

Calculate a hashCode for the passed in name.

Parameters
name:X500Name

the name the hashCode is required for.

Returns:int

the calculated hashCode.

copyHashTableback to summary
public static Hashtable<K, V> copyHashTable(Hashtable<K, V> paramsMap)

Tool function to shallow copy a Hashtable.

Parameters
paramsMap:Hashtable<K, V>

table to copy

Returns:Hashtable<K, V>

the copy of the table

encodeStringValueback to summary
protected ASN1Encodable encodeStringValue(ASN1ObjectIdentifier oid, String value)

Encoded every value into a UTF8String.

Subclasses should overwrite this method to change the encoding of specific types.

Parameters
oid:ASN1ObjectIdentifier

the DN oid of the value

value:String

the String representation of the value

Returns:ASN1Encodable

a the value encoded into a ASN.1 object. Never returns null.

foundMatchback to summary
private boolean foundMatch(boolean reverse, RDN rdn, RDN[] possRDNs)
rdnAreEqualback to summary
protected boolean rdnAreEqual(RDN rdn1, RDN rdn2)
stringToValueback to summary
public ASN1Encodable stringToValue(ASN1ObjectIdentifier oid, String value)

Implements org.bouncycastle.asn1.x500.X500NameStyle.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 AbstractX500NameStyle#encodeStringValue(ASN1ObjectIdentifier, String).

Subclasses should overwrite AbstractX500NameStyle#encodeStringValue(ASN1ObjectIdentifier, String) to change the encoding of specific types.
Parameters
oid:ASN1ObjectIdentifier

the DN name of the value.

value:String

the String representation of the value.

Returns:ASN1Encodable

Doc from org.bouncycastle.asn1.x500.X500NameStyle.stringToValue.

the ASN.1 equivalent for the value.