Package org.bouncycastle.asn1.x500
Class X500Name
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x500.X500Name
- All Implemented Interfaces:
ASN1Choice
,ASN1Encodable
,Encodable
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 }
-
Constructor Summary
ConstructorsConstructorDescriptionX500Name
(X500NameStyle style, String dirName) X500Name
(X500NameStyle style, RDN[] rDNs) X500Name
(X500NameStyle style, X500Name name) Deprecated.use the getInstance() method that takes a style. -
Method Summary
Modifier and TypeMethodDescriptionboolean
test for equality - note: case is ignored.return an array of OIDs contained in the attribute type of each RDN in structure order.static X500NameStyle
Return the current default style.static X500Name
getInstance
(Object obj) static X500Name
getInstance
(ASN1TaggedObject obj, boolean explicit) Return a X500Name based on the passed in tagged object.static X500Name
getInstance
(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.int
hashCode()
static void
setDefaultStyle
(X500NameStyle style) Set the default style for X500Name construction.int
size()
Method providing a primitive representation of this object suitable for encoding.toString()
Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, getEncoded, getEncoded, hasEncodedTagValue
-
Constructor Details
-
X500Name
Deprecated.use the getInstance() method that takes a style. -
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.
-
size
public int size() -
toASN1Primitive
Description copied from class:ASN1Object
Method providing a primitive representation of this object suitable for encoding.- Specified by:
toASN1Primitive
in interfaceASN1Encodable
- Specified by:
toASN1Primitive
in classASN1Object
- Returns:
- a primitive representation of this object.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classASN1Object
-
equals
test for equality - note: case is ignored.- Overrides:
equals
in classASN1Object
-
toString
-
setDefaultStyle
Set the default style for X500Name construction.- Parameters:
style
- an X500NameStyle
-
getDefaultStyle
Return the current default style.- Returns:
- default style for X500Name construction.
-