Top Inners Fields Constructors Methods
org.bouncycastle.oer

public Class OERInputStream

extends FilterInputStream
Class Inheritance
Known Direct Subclasses
org.bouncycastle.oer.OERInputStream.Choice, org.bouncycastle.oer.OERInputStream.Sequence
Imports
java.io.ByteArrayInputStream, .EOFException, .FilterInputStream, .IOException, .InputStream, .PrintWriter, java.math.BigInteger, java.util.Iterator, .List, org.bouncycastle.asn1.ASN1Boolean, .ASN1Encodable, .ASN1EncodableVector, .ASN1Enumerated, .ASN1Integer, .ASN1Object, .DERBitString, .DERIA5String, .DERNull, .DEROctetString, .DERSequence, .DERTaggedObject, .DERUTF8String, org.bouncycastle.util.BigIntegers, .Strings, org.bouncycastle.util.encoders.Hex, org.bouncycastle.util.io.Streams

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
public static class
OERInputStream.Sequence

OER sequence decoder, decodes prefix and determines which optional parts are available.

Field Summary

Modifier and TypeField and Description
private static final int[]
private static final int[]
protected PrintWriter
protected PrintWriter
private int
Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public
OERInputStream(InputStream
source stream.
src
)

Root decoder of OER streaming data.

public
OERInputStream(InputStream
The src.
src
,
int
the largest byte array that may eb allocated by this parser.
maxByteAllocation
)

Create an OER input and set the maximum byte array allocation size;

Method Summary

Modifier and TypeMethod and Description
private ASN1Encodable
absent(Element child)

private byte[]
allocateArray(int requiredSize)

public OERInputStream.Choice
private int
protected void
public BigInteger
public BigInteger
public BigInteger
public BigInteger
public BigInteger
int8()

public static ASN1Encodable

Returns:

Asn1Encodable instance
parse
(byte[]
The src
src
,
Element
The definition
element
)

Decode byte array.

public ASN1Object
parse(Element element)

public BigInteger
parseInt(boolean unsigned, int size)

protected ASN1Encodable
public OERInputStream.LengthInfo
readLength()

Reads a length determinant deals with long ans short versions.

public BigInteger
public BigInteger
public BigInteger
public BigInteger
Inherited from java.io.FilterInputStream:
availableclosemarkmarkSupportedreadreadreadresetskip

Field Detail

bitsback to summary
private static final int[] bits
bitsRback to summary
private static final int[] bitsR
debugOutputback to summary
protected PrintWriter debugOutput
debugStreamback to summary
protected PrintWriter debugStream
maxByteAllocationback to summary
private int maxByteAllocation

Constructor Detail

OERInputStreamback to summary
public OERInputStream(InputStream src)

Root decoder of OER streaming data. Maximum byte array allocation is 1Mb

Parameters
src:InputStream

source stream.

OERInputStreamback to summary
public OERInputStream(InputStream src, int maxByteAllocation)

Create an OER input and set the maximum byte array allocation size;

Parameters
src:InputStream

The src.

maxByteAllocation:int

the largest byte array that may eb allocated by this parser.

Method Detail

absentback to summary
private ASN1Encodable absent(Element child)
allocateArrayback to summary
private byte[] allocateArray(int requiredSize)
choiceback to summary
public OERInputStream.Choice choice() throws IOException
countOptionalChildTypesback to summary
private int countOptionalChildTypes(Element element)
debugPrintback to summary
protected void debugPrint(String what)
enumerationback to summary
public BigInteger enumeration() throws IOException
int16back to summary
public BigInteger int16() throws Exception
int32back to summary
public BigInteger int32() throws Exception
int64back to summary
public BigInteger int64() throws Exception
int8back to summary
public BigInteger int8() throws Exception
parseback to summary
public static ASN1Encodable parse(byte[] src, Element element) throws IOException

Decode byte array.

Parameters
src:byte[]

The src

element:Element

The definition

Returns:ASN1Encodable

Asn1Encodable instance

parseback to summary
public ASN1Object parse(Element element) throws IOException
parseIntback to summary
public BigInteger parseInt(boolean unsigned, int size) throws Exception
parseOpenTypeback to summary
protected ASN1Encodable parseOpenType(Element e) throws IOException
readLengthback to summary
public OERInputStream.LengthInfo readLength() throws IOException

Reads a length determinant deals with long ans short versions.

uint16back to summary
public BigInteger uint16() throws Exception
uint32back to summary
public BigInteger uint32() throws Exception
uint64back to summary
public BigInteger uint64() throws Exception
uint8back to summary
public BigInteger uint8() throws Exception
org.bouncycastle.oer back to summary

public Class OERInputStream.Choice

extends OERInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final int
pack-priv final int
Inherited from org.bouncycastle.oer.OERInputStream:
debugOutputdebugStream

Constructor Summary

AccessConstructor and Description
public
Choice(InputStream
source stream.
src
)

Root decoder of OER streaming data.

Method Summary

Modifier and TypeMethod and Description
public int
public int
public boolean
public boolean
public boolean
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.bouncycastle.oer.OERInputStream:
choicedebugPrintenumerationint16int32int64int8parseparseparseIntparseOpenTypereadLengthuint16uint32uint64uint8

Field Detail

preambleback to summary
pack-priv final int preamble
tagback to summary
pack-priv final int tag
tagClassback to summary
pack-priv final int tagClass

Constructor Detail

Choiceback to summary
public Choice(InputStream src) throws IOException

Root decoder of OER streaming data.

Parameters
src:InputStream

source stream.

Method Detail

getTagback to summary
public int getTag()
getTagClassback to summary
public int getTagClass()
isApplicationTagClassback to summary
public boolean isApplicationTagClass()
isContextSpecificback to summary
public boolean isContextSpecific()
isPrivateTagClassback to summary
public boolean isPrivateTagClass()
isUniversalTagClassback to summary
public boolean isUniversalTagClass()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

org.bouncycastle.oer back to summary

private final Class OERInputStream.LengthInfo

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final BigInteger
private final boolean

Constructor Summary

AccessConstructor and Description
public
LengthInfo(BigInteger length, boolean shortForm)

Method Summary

Modifier and TypeMethod and Description
private int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lengthback to summary
private final BigInteger length
shortFormback to summary
private final boolean shortForm

Constructor Detail

LengthInfoback to summary
public LengthInfo(BigInteger length, boolean shortForm)

Method Detail

intLengthback to summary
private int intLength()
org.bouncycastle.oer back to summary

public Class OERInputStream.Sequence

extends OERInputStream
Class Inheritance

OER sequence decoder, decodes prefix and determines which optional parts are available.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
private final boolean[]
Inherited from org.bouncycastle.oer.OERInputStream:
debugOutputdebugStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean
hasOptional(int index)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.bouncycastle.oer.OERInputStream:
choicedebugPrintenumerationint16int32int64int8parseparseparseIntparseOpenTypereadLengthuint16uint32uint64uint8

Field Detail

extensionFlagSetback to summary
private final boolean extensionFlagSet
preambleback to summary
private final int preamble
valuePresentback to summary
private final boolean[] valuePresent

Constructor Detail

Sequenceback to summary
public Sequence(InputStream src, Element element) throws IOException

Method Detail

hasExtensionback to summary
public boolean hasExtension()
hasOptionalback to summary
public boolean hasOptional(int index)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.