Package org.bouncycastle.asn1
Class DERSequenceGenerator
java.lang.Object
org.bouncycastle.asn1.ASN1Generator
org.bouncycastle.asn1.DERGenerator
org.bouncycastle.asn1.DERSequenceGenerator
A stream generator for DER SEQUENCEs
-
Field Summary
Fields inherited from class org.bouncycastle.asn1.ASN1Generator
_out
-
Constructor Summary
ConstructorsConstructorDescriptionUse the passed in stream as the target for the generator.DERSequenceGenerator
(OutputStream out, int tagNo, boolean 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 TypeMethodDescriptionvoid
addObject
(ASN1Encodable object) Add an object to the SEQUENCE being generated.void
addObject
(ASN1Primitive primitive) Add an ASN1.1 primitive to the SEQUENCE being generated.void
close()
Close of the generator, writing out the SEQUENCE.Return the target stream for the SEQUENCE.
-
Constructor Details
-
DERSequenceGenerator
Use the passed in stream as the target for the generator.- Parameters:
out
- target stream- Throws:
IOException
- if the target stream cannot be written to.
-
DERSequenceGenerator
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
- target streamtagNo
- the tag number to introduceisExplicit
- true if this is an explicitly tagged object, false otherwise.- Throws:
IOException
- if the target stream cannot be written to.
-
-
Method Details
-
addObject
Add an object to the SEQUENCE being generated.- Parameters:
object
- an ASN.1 encodable object to add.- Throws:
IOException
- if the target stream cannot be written to or the object cannot be encoded.
-
addObject
Add an ASN1.1 primitive to the SEQUENCE being generated.- Parameters:
primitive
- an ASN.1 primitive to add.- Throws:
IOException
- if the target stream cannot be written to or the primitive cannot be encoded.
-
getRawOutputStream
Return the target stream for the SEQUENCE.- Specified by:
getRawOutputStream
in classASN1Generator
- Returns:
- the OutputStream the SEQUENCE is being written to.
-
close
Close of the generator, writing out the SEQUENCE.- Throws:
IOException
- if the target stream cannot be written.
-