|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bouncycastle.asn1.ASN1Generator
org.bouncycastle.asn1.DLGenerator
Base class for stream generators for definite-length structures. Unlike the
BER generators, which stream indefinite-length
encodings, these write a definite-length header up front from a
caller-supplied body length and so can stream DL (and, with suitably
canonical contents, DER) encodings of structures too large to hold in
memory — body lengths are , so content larger than a Java array
can carry is supported.
The body length passed to a generator is a commitment: the matching
number of content octets must subsequently be written. Subclasses verify
this on close() and fail with an
IOException on a mismatch, since a wrongly-sized body silently
corrupts every enclosing length.
| Field Summary |
| Fields inherited from class org.bouncycastle.asn1.ASN1Generator |
_out |
| Constructor Summary | |
protected |
DLGenerator(java.io.OutputStream out)
|
protected |
DLGenerator(java.io.OutputStream out,
int tagNo,
boolean isExplicit)
|
| Method Summary | |
static long |
getDLEncodingLength(long bodyLength)
Return the total encoded length of a TLV with a single identifier octet (i.e. a tag number below 31) and content octets. |
static int |
getLengthOctetCount(long bodyLength)
Return the number of octets in the definite-length encoding of (the length octets only, excluding the identifier). |
java.io.OutputStream |
getRawOutputStream()
Return the actual stream object encodings are written to. |
protected void |
writeDLHeader(int tag,
long bodyLength)
Write the definite-length header(s) for this generator's structure: the base tag with , preceded (for an explicit tag) by a context-specific wrapper whose length covers the complete base TLV. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected DLGenerator(java.io.OutputStream out)
protected DLGenerator(java.io.OutputStream out,
int tagNo,
boolean isExplicit)
| Method Detail |
public java.io.OutputStream getRawOutputStream()
ASN1Generator
getRawOutputStream in class ASN1Generatorpublic static int getLengthOctetCount(long bodyLength)
bodyLength - number of content octets ()
public static long getDLEncodingLength(long bodyLength)
bodyLength - number of content octets ()
protected void writeDLHeader(int tag,
long bodyLength)
throws java.io.IOException
java.io.IOException
|
Bouncy Castle Cryptography Library 1.85 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||