Package org.bouncycastle.asn1.x500
Class X500Name
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x500.X500Name
- All Implemented Interfaces:
ASN1Choice,ASN1Encodable
public class X500Name extends ASN1Object implements ASN1Choice
Name ::= CHOICE {
RDNSequence }
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE {
type OBJECT IDENTIFIER,
value ANY }
-
Constructor Summary
Constructors Constructor Description X500Name(String dirName)X500Name(RDN[] rDNs)X500Name(X500NameStyle style, String dirName)X500Name(X500NameStyle style, RDN[] rDNs)X500Name(X500NameStyle style, X500Name name) -
Method Summary
Modifier and Type Method Description booleanequals(Object obj)test for equality - note: case is ignored.ASN1ObjectIdentifier[]getAttributeTypes()return an array of OIDs contained in the attribute type of each RDN in structure order.static X500NameStylegetDefaultStyle()Return the current default style.static X500NamegetInstance(Object obj)static X500NamegetInstance(ASN1TaggedObject obj, boolean explicit)Return a X500Name based on the passed in tagged object.static X500NamegetInstance(X500NameStyle style, Object obj)RDN[]getRDNs()return an array of RDNs in structure order.RDN[]getRDNs(ASN1ObjectIdentifier attributeType)return an array of RDNs containing the attribute type given by OID in structure order.inthashCode()Returns an integer hash code for this object.static voidsetDefaultStyle(X500NameStyle style)Set the default style for X500Name construction.ASN1PrimitivetoASN1Primitive()StringtoString()Returns a string containing a concise, human-readable description of this object.Methods inherited from class org.bouncycastle.asn1.ASN1Object
getEncoded, getEncoded, hasEncodedTagValue, toASN1Object
-
Constructor Details
-
X500Name
-
X500Name
-
X500Name
-
X500Name
-
X500Name
-
-
Method Details
-
getInstance
Return a X500Name based on the passed in tagged object.- Parameters:
obj- tag object holding name.explicit- true if explicitly tagged false otherwise.- Returns:
- the X500Name
-
getInstance
-
getInstance
-
getRDNs
return an array of RDNs in structure order.- Returns:
- an array of RDN objects.
-
getAttributeTypes
return an array of OIDs contained in the attribute type of each RDN in structure order.- Returns:
- an array, possibly zero length, of ASN1ObjectIdentifiers objects.
-
getRDNs
return an array of RDNs containing the attribute type given by OID in structure order.- Parameters:
attributeType- the type OID we are looking for.- Returns:
- an array, possibly zero length, of RDN objects.
-
toASN1Primitive
- Specified by:
toASN1Primitivein interfaceASN1Encodable- Specified by:
toASN1Primitivein classASN1Object
-
hashCode
public int hashCode()Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classASN1Object- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
equals
test for equality - note: case is ignored.- Overrides:
equalsin classASN1Object- Parameters:
obj- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
toString
Description copied from class:ObjectReturns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toStringmethod if you intend implementing your owntoStringmethod. -
setDefaultStyle
Set the default style for X500Name construction.- Parameters:
style- an X500NameStyle
-
getDefaultStyle
Return the current default style.- Returns:
- default style for X500Name construction.
-