|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.asn1.structures.RDN
This class implements the ASN.1 type RelativeDistinguishedName.
A Distinguished Name is used to specify a path within a X.500 directory information tree. A distinguished name is defined as a sequence of relative distinguished names, where a relative distinguished name is defined as follows:
RelativeDistinguishedName ::= SET OF AttributeValueAssertion AttributeValueAssertion ::= SEQUENCE { AttributeType OBJECT IDENTIFIER, AttributeValue ANY }
You may directly supply a AttributeValueAssertion (AVA
) when creating a
RelativeDistinguishedName object, or (and) you may use the addAVA
method for later adding some AVA, e.g.:
RDN rel_dis_name = new RDN(ObjectID.country, "AT"); rel_dis_name.addAVA(ObjectID.locality, "Graz");
When specifying issuer or subject within a X.509 certificate by a distinguished name composed of relative distinguished names, it is recommended that each set of AttributeValueAssertions constituting a RelativeDistinguishedName only should contain one element. This class only allows one AVA of a specific type to be added to a RDN object.
Name
,
AVA
Field Summary | |
protected Vector |
avas
Repository for AttributeValueAssertion objects. |
Constructor Summary | |
RDN()
Creates an empty RelativeDistinguishedName. |
|
RDN(ASN1Object obj)
Creates a RelativeDistinguishedName from an ASN1Object. |
|
RDN(ObjectID oid,
Object value)
Creates a new RelativeDistinguishedName for one AVA. |
Method Summary | |
void |
addAVA(AVA ava)
Adds a AttributeValueAssertion to this RelativeDistinguishedName. |
void |
addAVA(ObjectID oid,
Object value)
Creates a new AttributeValueAssertion with given type and value and adds it to this RelativeDistinguishedName. |
void |
decode(ASN1Object obj)
Decodes a RelativeDistinguishedName from the given ASN1Object. |
Enumeration |
elements()
Returns an enumeration of the AVAs in this RDN. |
boolean |
equals(Object obj)
Compares two RelativeDistinguishedNames. |
AVA |
getAVA()
This method returns one AVA. |
AVA |
getAVA(ObjectID oid)
Returns a AttributeValueAssertion of given type from this RelativeDistinguishedName. |
String |
getRFC2253String()
Returns a string representation of this RDN according to RFC 2253. |
int |
hashCode()
Returns the hashcode for this RDN. |
ASN1Object |
toASN1Object()
Returns the RelativeDistinguishedName as an ASN1Object. |
String |
toString()
Returns a string that represents the contents of this RDN. |
String |
toString(boolean detailed)
Returns a string that represents the contents of this RDN. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Vector avas
Constructor Detail |
public RDN()
public RDN(ObjectID oid, Object value)
AttributeValueAssertion
objects
may be added by using a proper addAVA
method.oid
- the type (object ID) of the AVA to be addedvalue
- the value of the AVA to be addedpublic RDN(ASN1Object obj) throws CodingException
The supplied ASN1Object represents an already existing RDN
that may have been created by means of the toASN1Object
method.
the
- RelativeDistinguishedName as ASN1ObjectCodingException
- if this ASN1Object could not be parsedMethod Detail |
public void decode(ASN1Object obj) throws CodingException
The supplied ASN1Object represents an already existing RDN object that
may have been created by means of the toASN1Object()
method.
decode
in interface ASN1Type
obj
- the RDN as ASN1ObjectCodingException
- if the ASN1Object has the wrong formatpublic ASN1Object toASN1Object()
toASN1Object
in interface ASN1Type
public void addAVA(ObjectID oid, Object value)
oid
- the attribute type of the AVA to be added, as object IDvalue
- the attribute valuepublic void addAVA(AVA ava)
ava
- the AttributeValueAssertion to addpublic AVA getAVA(ObjectID oid)
oid
- the type of the AVA to be searched for, as ObjectIDpublic AVA getAVA()
public Enumeration elements()
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the other RelativeDistinguishedNametrue
, if the two RelativeDistinguishedNames are equal, false
otherwisepublic String toString()
toString
in class Object
public String toString(boolean detailed)
public String getRFC2253String() throws RFC2253NameParserException
RFC 2253 specifies a string representation of Distinguished Names as used for LDAP lookups.
Each included AttributeTypeAndValue is represented as specified in
sections 2.3, 2.4 of RFC 2253 (adjoining AttributeTypeAndValues
(or AVA
s) are separated by a plus ("+")
character):
The attribute type is represented as described in section 2.3 of RFC 2253. If there is no known name string for the attribute type a dotted-decimal encoding of the attribute type´s identifier.
The string representation of the attribute value is either a hexadecimal represenation of its BER encoding (introduced by a "#" character) or based on the algorithm given in section 2.4 of RFC 2253 applying the following escaping mechanisms:
RFC2253NameParserException
- if the AVA cannot be represented
according to the rules above
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |