Top Description Fields Constructors Methods
org.bouncycastle.asn1

public Class DLSequence

extends ASN1Sequence
Class Inheritance
Imports
java.io.IOException, java.util.Enumeration

The DLSequence encodes a SEQUENCE using definite length form.

Field Summary

Modifier and TypeField and Description
private int
Inherited from org.bouncycastle.asn1.ASN1Sequence:
seq

Constructor Summary

AccessConstructor and Description
public
DLSequence()

Create an empty sequence

public
DLSequence(ASN1Encodable
the object to go in the sequence.
obj
)

create a sequence containing one object

public
DLSequence(ASN1EncodableVector
the vector of objects to make up the sequence.
v
)

create a sequence containing a vector of objects.

public
DLSequence(ASN1Encodable[]
the array of objects to make up the sequence.
array
)

create a sequence containing an array of objects.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
encode(ASN1OutputStream out)

Implements abstract org.bouncycastle.asn1.ASN1Sequence.encode.

A note on the implementation:

As DL requires the constructed, definite-length model to be used for structured types, this varies slightly from the ASN.1 descriptions given.

pack-priv int
encodedLength()

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.
private int
Inherited from org.bouncycastle.asn1.ASN1Sequence:
asn1EqualsgetInstancegetInstancegetObjectAtgetObjectshashCodeisConstructediteratorparsersizetoArraytoDERObjecttoDLObjecttoString

Field Detail

bodyLengthback to summary
private int bodyLength

Constructor Detail

DLSequenceback to summary
public DLSequence()

Create an empty sequence

DLSequenceback to summary
public DLSequence(ASN1Encodable obj)

create a sequence containing one object

Parameters
obj:ASN1Encodable

the object to go in the sequence.

DLSequenceback to summary
public DLSequence(ASN1EncodableVector v)

create a sequence containing a vector of objects.

Parameters
v:ASN1EncodableVector

the vector of objects to make up the sequence.

DLSequenceback to summary
public DLSequence(ASN1Encodable[] array)

create a sequence containing an array of objects.

Parameters
array:ASN1Encodable[]

the array of objects to make up the sequence.

Method Detail

encodeback to summary
pack-priv void encode(ASN1OutputStream out) throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Sequence.encode.

A note on the implementation:

As DL requires the constructed, definite-length model to be used for structured types, this varies slightly from the ASN.1 descriptions given. Rather than just outputting SEQUENCE, we also have to specify CONSTRUCTED, and the objects length.

encodedLengthback to summary
pack-priv int encodedLength() throws IOException

Implements abstract org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Doc from org.bouncycastle.asn1.ASN1Primitive.encodedLength.

Return the length of the encoding this object will produce.

Returns:int

the length of the object's encoding.

Exceptions
IOException:
if the encoding length cannot be calculated.
getBodyLengthback to summary
private int getBodyLength() throws IOException