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

public Class X500Name

extends ASN1Object
implements ASN1Choice
Class Inheritance
All Implemented Interfaces
org.bouncycastle.asn1.ASN1Choice
Imports
org.bouncycastle.asn1.ASN1Choice, .ASN1Encodable, .ASN1Object, .ASN1ObjectIdentifier, .ASN1Primitive, .ASN1Sequence, .ASN1TaggedObject, .DERSequence, org.bouncycastle.asn1.x500.style.BCStyle

The X.500 Name object.
    Name ::= CHOICE {
                      RDNSequence }

    RDNSequence ::= SEQUENCE OF RelativeDistinguishedName

    RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue

    AttributeTypeAndValue ::= SEQUENCE {
                                  type  OBJECT IDENTIFIER,
                                  value ANY }

Field Summary

Modifier and TypeField and Description
private static X500NameStyle
private int
private boolean
private RDN[]
private DERSequence
private X500NameStyle

Constructor Summary

AccessConstructor and Description
public
X500Name(X500NameStyle style, X500Name name)

Deprecated use the getInstance() method that takes a style.
private
X500Name(ASN1Sequence seq)

Constructor from ASN1Sequence the principal will be a list of constructed sets, each containing an (OID, String) pair.

private
public
X500Name(RDN[] rDNs)

public
X500Name(X500NameStyle style, RDN[] rDNs)

public
X500Name(String dirName)

public
X500Name(X500NameStyle style, String dirName)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides org.bouncycastle.asn1.ASN1Object.equals.

test for equality - note: case is ignored.
public ASN1ObjectIdentifier[]

Returns:

an array, possibly zero length, of ASN1ObjectIdentifiers objects.
getAttributeTypes
()

return an array of OIDs contained in the attribute type of each RDN in structure order.

public static X500NameStyle

Returns:

default style for X500Name construction.
getDefaultStyle
()

Return the current default style.

public static X500Name

Returns:

the X500Name
getInstance
(ASN1TaggedObject
tag object holding name.
obj
,
boolean
true if explicitly tagged false otherwise.
explicit
)

Return a X500Name based on the passed in tagged object.

public static X500Name
public static X500Name
public RDN[]

Returns:

an array of RDN objects.
getRDNs
()

return an array of RDNs in structure order.

public RDN[]

Returns:

an array, possibly zero length, of RDN objects.
getRDNs
(ASN1ObjectIdentifier
the type OID we are looking for.
attributeType
)

return an array of RDNs containing the attribute type given by OID in structure order.

public int
hashCode()

Overrides org.bouncycastle.asn1.ASN1Object.hashCode.

Returns a hash code value for the object.
public static void
setDefaultStyle(X500NameStyle
an X500NameStyle
style
)

Set the default style for X500Name construction.

public int
size()

public ASN1Primitive
toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.bouncycastle.asn1.ASN1Object:
encodeToencodeTogetEncodedgetEncodedhasEncodedTagValue

Field Detail

defaultStyleback to summary
private static X500NameStyle defaultStyle
hashCodeValueback to summary
private int hashCodeValue
isHashCodeCalculatedback to summary
private boolean isHashCodeCalculated
rdnsback to summary
private RDN[] rdns
rdnSeqback to summary
private DERSequence rdnSeq
styleback to summary
private X500NameStyle style

Constructor Detail

X500Nameback to summary
public X500Name(X500NameStyle style, X500Name name)

Deprecated

use the getInstance() method that takes a style.

X500Nameback to summary
private X500Name(ASN1Sequence seq)

Constructor from ASN1Sequence the principal will be a list of constructed sets, each containing an (OID, String) pair.

X500Nameback to summary
private X500Name(X500NameStyle style, ASN1Sequence seq)
X500Nameback to summary
public X500Name(RDN[] rDNs)
X500Nameback to summary
public X500Name(X500NameStyle style, RDN[] rDNs)
X500Nameback to summary
public X500Name(String dirName)
X500Nameback to summary
public X500Name(X500NameStyle style, String dirName)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides org.bouncycastle.asn1.ASN1Object.equals.

test for equality - note: case is ignored.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

getAttributeTypesback to summary
public ASN1ObjectIdentifier[] getAttributeTypes()

return an array of OIDs contained in the attribute type of each RDN in structure order.

Returns:ASN1ObjectIdentifier[]

an array, possibly zero length, of ASN1ObjectIdentifiers objects.

getDefaultStyleback to summary
public static X500NameStyle getDefaultStyle()

Return the current default style.

Returns:X500NameStyle

default style for X500Name construction.

getInstanceback to summary
public static X500Name getInstance(ASN1TaggedObject obj, boolean explicit)

Return a X500Name based on the passed in tagged object.

Parameters
obj:ASN1TaggedObject

tag object holding name.

explicit:boolean

true if explicitly tagged false otherwise.

Returns:X500Name

the X500Name

getInstanceback to summary
public static X500Name getInstance(Object obj)
getInstanceback to summary
public static X500Name getInstance(X500NameStyle style, Object obj)
getRDNsback to summary
public RDN[] getRDNs()

return an array of RDNs in structure order.

Returns:RDN[]

an array of RDN objects.

getRDNsback to summary
public RDN[] getRDNs(ASN1ObjectIdentifier attributeType)

return an array of RDNs containing the attribute type given by OID in structure order.

Parameters
attributeType:ASN1ObjectIdentifier

the type OID we are looking for.

Returns:RDN[]

an array, possibly zero length, of RDN objects.

hashCodeback to summary
public int hashCode()

Overrides org.bouncycastle.asn1.ASN1Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

setDefaultStyleback to summary
public static void setDefaultStyle(X500NameStyle style)

Set the default style for X500Name construction.

Parameters
style:X500NameStyle

an X500NameStyle

sizeback to summary
public int size()
toASN1Primitiveback to summary
public ASN1Primitive toASN1Primitive()

Implements abstract org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Implements org.bouncycastle.asn1.ASN1Encodable.toASN1Primitive.

Doc from org.bouncycastle.asn1.ASN1Object.toASN1Primitive.

Method providing a primitive representation of this object suitable for encoding.

Returns:ASN1Primitive

a primitive representation of this object.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.