public class UuidType extends AbstractDERType implements DEREncoder
Modifier and Type | Field and Description |
---|---|
private byte[] |
derItem
UUID to encode.
|
private static int |
UUID_LENGTH
Number of bytes in a uuid.
|
Constructor and Description |
---|
UuidType(DERTag tag,
UUID item)
Creates a new uuid type.
|
UuidType(UUID item)
Creates a new uuid type.
|
Modifier and Type | Method and Description |
---|---|
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.
|
encode, readBuffer
private static final int UUID_LENGTH
private final byte[] derItem
public UuidType(UUID item)
item
- to DER encodepublic UuidType(DERTag tag, UUID item)
tag
- der tag associated with this typeitem
- to DER encodeIllegalArgumentException
- if the der tag is constructedpublic byte[] encode()
DEREncoder
encode
in interface DEREncoder
public static UUID decode(ByteBuffer encoded)
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.public static byte[] toBytes(UUID uuid)
uuid
- to convertCopyright © 2003-2019 Virginia Tech. All Rights Reserved.