Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class DERSequenceGenerator

extends DERGenerator
Class Inheritance
Imports
java.io.ByteArrayOutputStream, .IOException, .OutputStream

A stream generator for DER SEQUENCEs

Field Summary

Modifier and TypeField and Description
private final ByteArrayOutputStream

Constructor Summary

AccessConstructor and Description
public
DERSequenceGenerator(OutputStream
target stream
out
)

Use the passed in stream as the target for the generator.

public
DERSequenceGenerator(OutputStream
target stream
out
,
int
the tag number to introduce
tagNo
,
boolean
true if this is an explicitly tagged object, false otherwise.
isExplicit
)

Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed SEQUENCE (possibly implicit).

Method Summary

Modifier and TypeMethod and Description
public void
addObject(ASN1Encodable
an ASN.1 encodable object to add.
object
)

Add an object to the SEQUENCE being generated.

public void
addObject(ASN1Primitive
an ASN.1 primitive to add.
primitive
)

Add an ASN1.1 primitive to the SEQUENCE being generated.

public void
close()

Close of the generator, writing out the SEQUENCE.

public OutputStream

Returns:

the OutputStream the SEQUENCE is being written to.
getRawOutputStream
()

Implements abstract org.bouncycastle.asn1.ASN1Generator.getRawOutputStream.

Return the target stream for the SEQUENCE.
Inherited from org.bouncycastle.asn1.DERGenerator:
writeDEREncodedwriteDEREncoded

Field Detail

_bOutback to summary
private final ByteArrayOutputStream _bOut

Constructor Detail

DERSequenceGeneratorback to summary
public DERSequenceGenerator(OutputStream out) throws IOException

Use the passed in stream as the target for the generator.

Parameters
out:OutputStream

target stream

Exceptions
IOException:
if the target stream cannot be written to.
DERSequenceGeneratorback to summary
public DERSequenceGenerator(OutputStream out, int tagNo, boolean isExplicit) throws IOException

Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed SEQUENCE (possibly implicit).

Parameters
out:OutputStream

target stream

tagNo:int

the tag number to introduce

isExplicit:boolean

true if this is an explicitly tagged object, false otherwise.

Exceptions
IOException:
if the target stream cannot be written to.

Method Detail

addObjectback to summary
public void addObject(ASN1Encodable object) throws IOException

Add an object to the SEQUENCE being generated.

Parameters
object:ASN1Encodable

an ASN.1 encodable object to add.

Exceptions
IOException:
if the target stream cannot be written to or the object cannot be encoded.
addObjectback to summary
public void addObject(ASN1Primitive primitive) throws IOException

Add an ASN1.1 primitive to the SEQUENCE being generated.

Parameters
primitive:ASN1Primitive

an ASN.1 primitive to add.

Exceptions
IOException:
if the target stream cannot be written to or the primitive cannot be encoded.
closeback to summary
public void close() throws IOException

Close of the generator, writing out the SEQUENCE.

Exceptions
IOException:
if the target stream cannot be written.
getRawOutputStreamback to summary
public OutputStream getRawOutputStream()

Implements abstract org.bouncycastle.asn1.ASN1Generator.getRawOutputStream.

Return the target stream for the SEQUENCE.

Returns:OutputStream

the OutputStream the SEQUENCE is being written to.