Package org.ldaptive.asn1
Class DN
- java.lang.Object
-
- org.ldaptive.asn1.DN
-
- All Implemented Interfaces:
DEREncoder
public class DN extends Object implements DEREncoder
A sequence of RDN values.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_CODE_SEED
hash code seed.private RDN[]
rdns
RDNs in this RDN sequence.
-
Constructor Summary
Constructors Constructor Description DN(Collection<RDN> names)
Creates a new DN.DN(RDN... names)
Creates a new DN.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DN
decode(DERBuffer encoded)
Converts bytes in the buffer to a DN by reading from the current position to the limit.byte[]
encode()
Encode this object into it's DER type.boolean
equals(Object o)
RDN[]
getRDNs()
Returns the RDNs in this DN.int
hashCode()
String
toString()
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
rdns
private final RDN[] rdns
RDNs in this RDN sequence.
-
-
Constructor Detail
-
DN
public DN(Collection<RDN> names)
Creates a new DN.- Parameters:
names
- RDNs in this sequence
-
DN
public DN(RDN... names)
Creates a new DN.- Parameters:
names
- RDNs in this sequence
-
-
Method Detail
-
getRDNs
public RDN[] getRDNs()
Returns the RDNs in this DN.- Returns:
- RDNs
-
encode
public byte[] encode()
Description copied from interface:DEREncoder
Encode this object into it's DER type.- Specified by:
encode
in interfaceDEREncoder
- Returns:
- DER encoded object
-
decode
public static DN decode(DERBuffer encoded)
Converts bytes in the buffer to a DN by reading from the current position to the limit.- Parameters:
encoded
- buffer containing DER-encoded data where the buffer is positioned at the tag of the DN and the limit is set beyond the last byte of DN data.- Returns:
- decoded bytes as a DN
-
-