Class ASN1BitString
-
- All Implemented Interfaces:
-
io.anyline.nfc.bouncycastle.asn1.ASN1BitStringParser
,io.anyline.nfc.bouncycastle.asn1.ASN1Encodable
,io.anyline.nfc.bouncycastle.asn1.ASN1String
,io.anyline.nfc.bouncycastle.asn1.InMemoryRepresentable
,io.anyline.nfc.bouncycastle.util.Encodable
public abstract class ASN1BitString extends ASN1Primitive implements ASN1String, ASN1BitStringParser
Base class for BIT STRING objects
-
-
Method Summary
Modifier and Type Method Description static ASN1BitString
getInstance(Object obj)
static ASN1BitString
getInstance(ASN1TaggedObject taggedObject, boolean explicit)
InputStream
getBitStream()
Return an InputStream representing the contents of the BIT STRING. InputStream
getOctetStream()
Return an InputStream representing the contents of the BIT STRING, where the content is expected to be octet-aligned (this will be automatically checked during parsing). ASN1BitStringParser
parser()
String
getString()
Return a String representation of this BIT STRING int
intValue()
Array<byte>
getOctets()
Return the octets contained in this BIT STRING, checking that this BIT STRING really does represent an octet aligned string. Array<byte>
getBytes()
int
getPadBits()
Return the number of pad bits, if any, in the final byte, if any, read from getBitStream. String
toString()
int
hashCode()
ASN1Primitive
getLoadedObject()
Get the in-memory representation of the ASN.1 object. -
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Primitive
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive
-
Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Object
equals, getEncoded, getEncoded
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getInstance
static ASN1BitString getInstance(Object obj)
-
getInstance
static ASN1BitString getInstance(ASN1TaggedObject taggedObject, boolean explicit)
-
getBitStream
InputStream getBitStream()
Return an InputStream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. See getPadBits.
- Returns:
an InputStream with its source as the BIT STRING content.
-
getOctetStream
InputStream getOctetStream()
Return an InputStream representing the contents of the BIT STRING, where the content is expected to be octet-aligned (this will be automatically checked during parsing).
- Returns:
an InputStream with its source as the BIT STRING content.
-
parser
ASN1BitStringParser parser()
-
getString
String getString()
Return a String representation of this BIT STRING
- Returns:
a String representation.
-
intValue
int intValue()
- Returns:
the value of the bit string as an int (truncating if necessary)
-
getOctets
Array<byte> getOctets()
Return the octets contained in this BIT STRING, checking that this BIT STRING really does represent an octet aligned string. Only use this method when the standard you are following dictates that the BIT STRING will be octet aligned.
- Returns:
a copy of the octet aligned data.
-
getPadBits
int getPadBits()
Return the number of pad bits, if any, in the final byte, if any, read from getBitStream. This number is in the range zero to seven. That number of the least significant bits of the final byte, if any, are not part of the contents and should be ignored. NOTE: Must be called AFTER the stream has been fully processed. (Does not need to be called if getOctetStream was used instead of getBitStream).
- Returns:
the number of pad bits. In the range zero to seven.
-
hashCode
int hashCode()
-
getLoadedObject
ASN1Primitive getLoadedObject()
Get the in-memory representation of the ASN.1 object.
- Returns:
an ASN1Primitive representing the loaded object.
-
-
-
-