Top Description Methods
org.bouncycastle.asn1.x500

public Interface X500NameStyle

Known Direct Implementers
org.bouncycastle.asn1.x500.style.AbstractX500NameStyle
Imports
org.bouncycastle.asn1.ASN1Encodable, .ASN1ObjectIdentifier

This interface provides a profile to conform to when DNs are being converted into strings and back. The idea being that we'll be able to deal with the number of standard ways the fields in a DN should be encoded into their ASN.1 counterparts - a number that is rapidly approaching the number of machines on the internet.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if name1 = name 2, false otherwise.
areEqual
(X500Name
first name for comparison.
name1
,
X500Name
second name for comparison.
name2
)

Return true if the two names are equal.

public ASN1ObjectIdentifier

Returns:

an OID
attrNameToOID
(String
the string to match.
attrName
)

Return the OID associated with the passed in name.

public int

Returns:

the calculated hashCode.
calculateHashCode
(X500Name
the name the hashCode is required for.
name
)

Calculate a hashCode for the passed in name.

public RDN[]

Returns:

an array of corresponding RDNs.
fromString
(String
the String representation.
dirName
)

Return an array of RDN generated from the passed in String.

public String[]

Returns:

an array of String aliases for the OID, zero length if there are none.
oidToAttrNames
(ASN1ObjectIdentifier
the OID of interest.
oid
)

Return the acceptable names in a String DN that map to OID.

public String

Returns:

the name displayed in toString(), null if no mapping provided.
oidToDisplayName
(ASN1ObjectIdentifier
the OID of interest.
oid
)

Return the display name for toString() associated with the OID.

public ASN1Encodable

Returns:

the ASN.1 equivalent for the value.
stringToValue
(ASN1ObjectIdentifier
the OID associated with the value in the DN.
oid
,
String
the value of the particular DN component.
value
)

Convert the passed in String value into the appropriate ASN.1 encoded object.

public String

Returns:

a String representation.
toString
(X500Name
the name to convert.
name
)

Convert the passed in X500Name to a String.

Method Detail

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

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.

attrNameToOIDback to summary
public ASN1ObjectIdentifier attrNameToOID(String attrName)

Return the OID associated with the passed in name.

Parameters
attrName:String

the string to match.

Returns:ASN1ObjectIdentifier

an OID

calculateHashCodeback to summary
public int calculateHashCode(X500Name name)

Calculate a hashCode for the passed in name.

Parameters
name:X500Name

the name the hashCode is required for.

Returns:int

the calculated hashCode.

fromStringback to summary
public RDN[] fromString(String dirName)

Return an array of RDN generated from the passed in String.

Parameters
dirName:String

the String representation.

Returns:RDN[]

an array of corresponding RDNs.

oidToAttrNamesback to summary
public String[] oidToAttrNames(ASN1ObjectIdentifier oid)

Return the acceptable names in a String DN that map to OID.

Parameters
oid:ASN1ObjectIdentifier

the OID of interest.

Returns:String[]

an array of String aliases for the OID, zero length if there are none.

oidToDisplayNameback to summary
public String oidToDisplayName(ASN1ObjectIdentifier oid)

Return the display name for toString() associated with the OID.

Parameters
oid:ASN1ObjectIdentifier

the OID of interest.

Returns:String

the name displayed in toString(), null if no mapping provided.

stringToValueback to summary
public ASN1Encodable stringToValue(ASN1ObjectIdentifier oid, String value)

Convert the passed in String value into the appropriate ASN.1 encoded object.

Parameters
oid:ASN1ObjectIdentifier

the OID associated with the value in the DN.

value:String

the value of the particular DN component.

Returns:ASN1Encodable

the ASN.1 equivalent for the value.

toStringback to summary
public String toString(X500Name name)

Convert the passed in X500Name to a String.

Parameters
name:X500Name

the name to convert.

Returns:String

a String representation.