org.ldaptive.asn1
Class UuidType

java.lang.Object
  extended by org.ldaptive.asn1.AbstractDERType
      extended by org.ldaptive.asn1.UuidType
All Implemented Interfaces:
DEREncoder

public class UuidType
extends AbstractDERType
implements DEREncoder

Converts UUIDs to and from their DER encoded format. See RFC 4122.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Constructor Summary
UuidType(DERTag tag, UUID item)
          Creates a new uuid type.
UuidType(UUID item)
          Creates a new uuid type.
 
Method Summary
static UUID decode(ByteBuffer encoded)
          Converts bytes in the buffer to a uuid by reading from the current position to the limit.
 byte[] encode()
          Encode this object into it's DER type.
static byte[] toBytes(UUID uuid)
          Converts the supplied uuid to a byte array.
 
Methods inherited from class org.ldaptive.asn1.AbstractDERType
encode, readBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UuidType

public UuidType(UUID item)
Creates a new uuid type.

Parameters:
item - to DER encode

UuidType

public UuidType(DERTag tag,
                UUID item)
Creates a new uuid type.

Parameters:
tag - der tag associated with this type
item - to DER encode
Throws:
IllegalArgumentException - if the der tag is constructed
Method Detail

encode

public byte[] encode()
Encode this object into it's DER type.

Specified by:
encode in interface DEREncoder
Returns:
DER encoded object

decode

public static UUID decode(ByteBuffer encoded)
Converts bytes in the buffer to a uuid by reading from the current position to the limit.

Parameters:
encoded - buffer containing DER-encoded data where the buffer is positioned at the start of uuid bytes and the limit is set beyond the last byte of uuid data.
Returns:
decoded bytes as a uuid.

toBytes

public static byte[] toBytes(UUID uuid)
Converts the supplied uuid to a byte array.

Parameters:
uuid - to convert
Returns:
byte array


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.