public class DERBitString extends ASN1Primitive implements ASN1String
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
protected int |
padBits |
private static char[] |
table |
Modifier | Constructor and Description |
---|---|
|
DERBitString(ASN1Encodable obj) |
|
DERBitString(byte[] data) |
|
DERBitString(byte[] data,
int padBits) |
protected |
DERBitString(byte data,
int padBits) |
|
DERBitString(int value) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
asn1Equals(ASN1Primitive o) |
(package private) void |
encode(ASN1OutputStream out) |
(package private) int |
encodedLength() |
(package private) static DERBitString |
fromInputStream(int length,
InputStream stream) |
(package private) static DERBitString |
fromOctetString(byte[] bytes) |
byte[] |
getBytes() |
protected static byte[] |
getBytes(int bitString) |
static DERBitString |
getInstance(ASN1TaggedObject obj,
boolean explicit)
return a Bit String from a tagged object.
|
static DERBitString |
getInstance(Object obj)
return a Bit String from the passed in object
|
int |
getPadBits() |
protected static int |
getPadBits(int bitString) |
String |
getString() |
int |
hashCode() |
int |
intValue() |
(package private) boolean |
isConstructed() |
String |
toString() |
equals, fromByteArray, toASN1Primitive, toDERObject, toDLObject
getEncoded, getEncoded, hasEncodedTagValue, toASN1Object
private static final char[] table
protected byte[] data
protected int padBits
protected DERBitString(byte data, int padBits)
public DERBitString(byte[] data, int padBits)
data
- the octets making up the bit string.padBits
- the number of extra bits at the end of the string.public DERBitString(byte[] data)
public DERBitString(int value)
public DERBitString(ASN1Encodable obj) throws IOException
IOException
protected static int getPadBits(int bitString)
bitString
- an int containing the BIT STRINGprotected static byte[] getBytes(int bitString)
bitString
- an int containing the BIT STRINGpublic static DERBitString getInstance(Object obj)
obj
- a DERBitString or an object that can be converted into one.IllegalArgumentException
- if the object cannot be converted.public static DERBitString getInstance(ASN1TaggedObject obj, boolean explicit)
obj
- the tagged object holding the object we wantexplicit
- true if the object is meant to be explicitly
tagged false otherwise.IllegalArgumentException
- if the tagged object cannot
be converted.public byte[] getBytes()
public int getPadBits()
public int intValue()
boolean isConstructed()
isConstructed
in class ASN1Primitive
int encodedLength()
encodedLength
in class ASN1Primitive
void encode(ASN1OutputStream out) throws IOException
encode
in class ASN1Primitive
IOException
public int hashCode()
hashCode
in class ASN1Primitive
protected boolean asn1Equals(ASN1Primitive o)
asn1Equals
in class ASN1Primitive
public String getString()
getString
in interface ASN1String
static DERBitString fromOctetString(byte[] bytes)
static DERBitString fromInputStream(int length, InputStream stream) throws IOException
IOException