Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class DERBitString

extends ASN1BitString
Class Inheritance
Known Direct Subclasses
org.bouncycastle.asn1.cmp.PKIFailureInfo, org.bouncycastle.asn1.misc.NetscapeCertType, org.bouncycastle.asn1.x509.ReasonFlags
Imports
java.io.IOException

A BIT STRING with DER encoding - the first byte contains the count of padding bits included in the byte array's last byte.

Field Summary

Inherited from org.bouncycastle.asn1.ASN1BitString:
datapadBits

Constructor Summary

AccessConstructor and Description
protected
DERBitString(byte data, int padBits)

public
DERBitString(byte[]
the octets making up the bit string.
data
,
int
the number of extra bits at the end of the string.
padBits
)

public
DERBitString(byte[] data)

public
DERBitString(int value)

public

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv int
encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.
pack-priv static DERBitString
fromOctetString(byte[] bytes)

public static DERBitString

Returns:

a DERBitString instance, or null.
getInstance
(Object
a DERBitString or an object that can be converted into one.
obj
)

return a Bit String from the passed in object

public static DERBitString

Returns:

a DERBitString instance, or null.
getInstance
(ASN1TaggedObject
the tagged object holding the object we want
obj
,
boolean
true if the object is meant to be explicitly tagged false otherwise.
explicit
)

return a Bit String from a tagged object.

pack-priv boolean
isConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.
private static byte[]
toByteArray(byte data)

Inherited from org.bouncycastle.asn1.ASN1BitString:
asn1EqualsderFormfromInputStreamgetBytesgetBytesgetLoadedObjectgetOctetsgetPadBitsgetPadBitsgetStringhashCodeintValuetoDERObjecttoDLObjecttoString

Constructor Detail

DERBitStringback to summary
protected DERBitString(byte data, int padBits)
DERBitStringback to summary
public DERBitString(byte[] data, int padBits)
Parameters
data:byte[]

the octets making up the bit string.

padBits:int

the number of extra bits at the end of the string.

DERBitStringback to summary
public DERBitString(byte[] data)
DERBitStringback to summary
public DERBitString(int value)
DERBitStringback to summary
public DERBitString(ASN1Encodable obj) throws IOException

Method Detail

encodeback to summary
pack-priv void encode(ASN1OutputStream out) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1BitString.encode.

encodedLengthback to summary
pack-priv int encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.

Returns:int

the length of the object's encoding.

fromOctetStringback to summary
pack-priv static DERBitString fromOctetString(byte[] bytes)
getInstanceback to summary
public static DERBitString getInstance(Object obj)

return a Bit String from the passed in object

Parameters
obj:Object

a DERBitString or an object that can be converted into one.

Returns:DERBitString

a DERBitString instance, or null.

Exceptions
IllegalArgumentException:
if the object cannot be converted.
getInstanceback to summary
public static DERBitString getInstance(ASN1TaggedObject obj, boolean explicit)

return a Bit String from a tagged object.

Parameters
obj:ASN1TaggedObject

the tagged object holding the object we want

explicit:boolean

true if the object is meant to be explicitly tagged false otherwise.

Returns:DERBitString

a DERBitString instance, or null.

Exceptions
IllegalArgumentException:
if the tagged object cannot be converted.
isConstructedback to summary
pack-priv boolean isConstructed()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Doc from org.bouncycastle.asn1.ASN1Primitive.isConstructed.

Return true if this objected is a CONSTRUCTED one, false otherwise.

Returns:boolean

true if CONSTRUCTED bit set on object's tag, false otherwise.

toByteArrayback to summary
private static byte[] toByteArray(byte data)