public class BooleanType extends AbstractDERType implements DEREncoder
Constructor and Description |
---|
BooleanType(boolean item)
Creates a new boolean type.
|
BooleanType(DERTag tag,
boolean item)
Creates a new boolean type.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
decode(ByteBuffer encoded)
Converts bytes in the buffer to a boolean by reading from the current position to the limit.
|
byte[] |
encode()
Encode this object into it's DER type.
|
static byte[] |
toBytes(boolean b)
Converts the supplied boolean to a byte array.
|
encode, readBuffer
public BooleanType(boolean item)
item
- to DER encodepublic BooleanType(DERTag tag, boolean 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 boolean decode(ByteBuffer encoded)
encoded
- buffer containing DER-encoded data where the buffer is positioned at the start of boolean bytes
and the limit is set beyond the last byte of integer data.public static byte[] toBytes(boolean b)
b
- to convertCopyright © 2023. All rights reserved.