public class

DERBitString

extends ASN1Object
implements DERString
java.lang.Object
   ↳ org.bouncycastle.asn1.ASN1Encodable
     ↳ org.bouncycastle.asn1.DERObject
       ↳ org.bouncycastle.asn1.ASN1Object
         ↳ org.bouncycastle.asn1.DERBitString
Known Direct Subclasses

Summary

[Expand]
Inherited Constants
From class org.bouncycastle.asn1.ASN1Encodable
From interface org.bouncycastle.asn1.DERTags
Fields
protected byte[] data
protected int padBits
Public Constructors
DERBitString(byte[] data, int padBits)
DERBitString(byte[] data)
DERBitString(DEREncodable obj)
Protected Constructors
DERBitString(byte data, int padBits)
Public Methods
byte[] getBytes()
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()
String getString()
int hashCode()
int intValue()
String toString()
Protected Methods
boolean asn1Equals(DERObject o)
static byte[] getBytes(int bitString)
return the correct number of bytes for a bit string defined in a 32 bit constant
static int getPadBits(int bitString)
return the correct number of pad bits for a bit string defined in a 32 bit constant
[Expand]
Inherited Methods
From class org.bouncycastle.asn1.ASN1Object
From class org.bouncycastle.asn1.DERObject
From class org.bouncycastle.asn1.ASN1Encodable
From class java.lang.Object
From interface org.bouncycastle.asn1.ASN1String
From interface org.bouncycastle.asn1.DEREncodable

Fields

protected byte[] data

protected int padBits

Public Constructors

public DERBitString (byte[] data, int padBits)

Parameters
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 (DEREncodable obj)

Protected Constructors

protected DERBitString (byte data, int padBits)

Public Methods

public byte[] getBytes ()

public static DERBitString getInstance (ASN1TaggedObject obj, boolean explicit)

return a Bit String from a tagged object.

Parameters
obj the tagged object holding the object we want
explicit true if the object is meant to be explicitly tagged false otherwise.
Throws
IllegalArgumentException if the tagged object cannot be converted.

public static DERBitString getInstance (Object obj)

return a Bit String from the passed in object

Throws
IllegalArgumentException if the object cannot be converted.

public int getPadBits ()

public String getString ()

public int hashCode ()

public int intValue ()

Returns
  • the value of the bit string as an int (truncating if necessary)

public String toString ()

Protected Methods

protected boolean asn1Equals (DERObject o)

protected static byte[] getBytes (int bitString)

return the correct number of bytes for a bit string defined in a 32 bit constant

protected static int getPadBits (int bitString)

return the correct number of pad bits for a bit string defined in a 32 bit constant