Package org.bouncycastle.asn1
Class DLBitStringParser
- java.lang.Object
-
- org.bouncycastle.asn1.DLBitStringParser
-
- All Implemented Interfaces:
ASN1BitStringParser,ASN1Encodable,InMemoryRepresentable
public class DLBitStringParser extends java.lang.Object implements ASN1BitStringParser
Parser for a DL encoded BIT STRING.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.InputStreamgetBitStream()Return an InputStream representing the contents of the BIT STRING.ASN1PrimitivegetLoadedObject()Get the in-memory representation of the ASN.1 object.java.io.InputStreamgetOctetStream()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).intgetPadBits()Return the number of pad bits, if any, in the final byte, if any, read fromASN1BitStringParser.getBitStream().ASN1PrimitivetoASN1Primitive()Return an object, possibly constructed, of ASN.1 primitives
-
-
-
Method Detail
-
getBitStream
public java.io.InputStream getBitStream() throws java.io.IOExceptionDescription copied from interface:ASN1BitStringParserReturn an InputStream representing the contents of the BIT STRING. The final byte, if any, may include pad bits. SeeASN1BitStringParser.getPadBits().- Specified by:
getBitStreamin interfaceASN1BitStringParser- Returns:
- an InputStream with its source as the BIT STRING content.
- Throws:
java.io.IOException
-
getOctetStream
public java.io.InputStream getOctetStream() throws java.io.IOExceptionDescription copied from interface:ASN1BitStringParserReturn 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).- Specified by:
getOctetStreamin interfaceASN1BitStringParser- Returns:
- an InputStream with its source as the BIT STRING content.
- Throws:
java.io.IOException
-
getPadBits
public int getPadBits()
Description copied from interface:ASN1BitStringParserReturn the number of pad bits, if any, in the final byte, if any, read fromASN1BitStringParser.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 ifASN1BitStringParser.getOctetStream()was used instead ofASN1BitStringParser.getBitStream()).- Specified by:
getPadBitsin interfaceASN1BitStringParser- Returns:
- the number of pad bits. In the range zero to seven.
-
getLoadedObject
public ASN1Primitive getLoadedObject() throws java.io.IOException
Description copied from interface:InMemoryRepresentableGet the in-memory representation of the ASN.1 object.- Specified by:
getLoadedObjectin interfaceInMemoryRepresentable- Returns:
- an ASN1Primitive representing the loaded object.
- Throws:
java.io.IOException- for bad input data.
-
toASN1Primitive
public ASN1Primitive toASN1Primitive()
Description copied from interface:ASN1EncodableReturn an object, possibly constructed, of ASN.1 primitives- Specified by:
toASN1Primitivein interfaceASN1Encodable- Returns:
- an ASN.1 primitive.
-
-